How to get Header value

Hello

How can i get value from grid header?

[code] DELG = DLW.attachGrid();
DELG.setImagePath("/statics/dhtmlx/common/imgs/");
DELG.setHeader(“User ID,User Name”);
DELG.attachHeader("#numeric_filter,#text_filter");
DELG.setColumnIds(“user_id,user_name”);
DELG.setColSorting(“int,str”);
DELG.setInitWidths(“80,100”);
DELG.setColAlign(“right,left”);
DELG.enablePaging(true,25,3,“pager”);
DELG.setPagingSkin(“toolbar”);
DELG.i18n.paging = App.LocalizePaging;
DELG.load("/api/demand/all",function()
{
DLW.progressOff();
},“js”);
DELG.init();
DELG.enableHeaderMenu();
DELG.setEditable(false);

        //Context Menu
        function event(MenuItemId,type)
		{ 
            switch(MenuItemId)
			{
                case "edit":
                    DELTOOL.callEvent("onClick",["editrecord"]);
                    break;
                case "del":
                    DELTOOL.callEvent("onClick",["deleterecord"]);
                    break;
            }

            return true;
        }

        menu = new dhtmlXMenuObject();
        menu.renderAsContextMenu();
        menu.attachEvent("onClick",event);
        menu.loadStruct('<menu id="0"><item text="Edit" id="edit"/><item text="Delete" id="del"/></menu>');
        //Context Menu

        DELG.enableContextMenu(menu);
        // Grid 
		
        // Event
        DELG.attachEvent("onRowDblClicked",editRecord);
        DELG.attachEvent("onEnter",editRecord);
        DELG.attachEvent("onRowSelect",function()
		{ 
            	DELTOOL.enableItem('editrecord'); 
                DELTOOL.enableItem('deleterecord'); 
        });
        DELG.attachEvent("onBeforeContextMenu",function(rowId,celInd,obj){  obj.selectRowById(rowId,true,true,true); return true; });
        DELTOOL.attachEvent("onClick", function(id){
// user_id value must be here...
            if(id=='newrecord'){ editRecord(''); }
            if(id=='editrecord'){ editRecord('edit'); }
            if(id=='deleterecord'){ deleteRecord(); }
        });[/code]

So, how can i get the entered value from user_id when i click “editRecord” button ?

DELG.attachEvent(“onBeforeContextMenu”,function(rowId,celInd,obj){
val=DELG.cellById(rowId,0).getValue();

dear sematik

thanks for reply but i am afraid your code gets value from grid cell.

I have been trying to solve this issue since your provided code, but all i have got is “undefined”. I need value from DELG.attachHeader not from grid itself.

Please, try to use the getColumnLabel() method:
docs.dhtmlx.com/api__dhtmlxgrid_ … label.html

still “undefined”

Okay, now i have Label. But i want to get data inside of input area. please take a look attached ScreenShot. I need “Ars” or whatever user type in there on onClick event.

I need exactly the same thing!! Is there any way to get what the user fills in there?

You need to get the values of the filter input?
val=myGrid.getFilterElement(col_ind).value

yesssss that’s it.

Dear Sematik,
I tried to use getFilterElement but it just says ‘[object%20HTMLSelectElement]’
Am I doing something wrong?

For a #combo_filter you need to use:
myGrid.getFilterElement(ind).getComboText()

I get this outcome on the normal text and selection filters though…

I try to get the value the user writes / selects and put it in the URL of a hyperlink in a custom column.
This is my code for the custom column:

function eXcell_ticketmail(cell){ // the eXcell name is defined here if (cell){ // the default pattern, just copy it this.cell = cell; this.grid = this.cell.parentNode.grid; } this.edit = function(){} //read-only cell doesn't have edit method // the cell is read-only, so it's always in the disabled state this.isDisabled = function(){ return true; } this.setValue=function(val){ var row_idd=this.cell.parentNode.idd; this.val = this.getValue(); var filterObject=mygrid.getFilterElement(3); // console.log(this.val); // actual data processing may be placed here, for now we just set value as it is this.setCValue("<input type='button' onclick=\"window.open('http://jtc.ae/pre/buyer-sales/?action=ticket_mail&"+val+"&"+filterObject+"','_self')\" value='Send ticket'>",val); } } eXcell_ticketmail.prototype = new eXcell;// nests all other methods from the base class

var filterObject=mygrid.getFilterElement(3);
You need to use:
var filterObject=mygrid.getFilterElement(3).value;

Thank you this works!