Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by Tejas Shah on Aug 07, 2008 00:34
open dhtmlx forum
DHTMLX Grid : enableHeaderMenu(), customize and serializeToCSV()

Hi there,
I am using enableHeaderMenu() to show context menu for column, but can I customize the context menu options which are shown ??? I want to have options like "Add Column", "Remove Column" etc.

Also when I use serializeToCSV(), then I want that if I uncheck a column, its content should not in included in CSV format, how to do this ?
Answer posted by Support on Aug 07, 2008 02:46
>>I want to have options like "Add Column", "Remove Column" etc.
The content of header menu is hardcoded, you can customize
    dhtmlxgrid_hmenu.js  ( line 78 )
in any necessary way. 

>>its content should not in included in CSV format
can be done as
var csv=[];
mygrid.forEachRow(function(id){
          if (mygrid.cells(id,0).getValue()==1)
             csv.push(mygrid._serializeRowToCVS(mygrid.getRowById(id)));
});
csv = csv.join("\n");