Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by arao on Dec 18, 2007 10:28
open dhtmlx forum
dhtmlxGrid - Dsiplay Editable Header with checkbox + Seraliize

Hi,

How can I display an Editable Header Column + checkbox besides it for the user to Select.

Basically for our project, we want the users to be able to change the Column Header text and also be able to select a Column to be deleted, besides having the default sort functionality ;-)

Also while serializing to CVSL we want ONLY the header name (of columns in grid) to be included as part of data (not the checkbox etc) as tyeh user can export the CSV to Excel etc

The data for the grid is generated dynamically by the server side/action & loaded using the

        grid.loadXML(dataURL);

Thanks
Answer posted by Support on Dec 19, 2007 02:29
>>display an Editable Header Column
The column headers in dhtmlxgrid is not editable, but they allow any HTML usage inside them , so it possible to create some kind of active zones in them, but it will be fully custom functionality , there is no native support for it.


>>+ checkbox besides it for the user to Select
Because column can contain any HTML it is pretty easy to add such content
    grid.setHeader("A,B,C <input type='checkbox'/>");.

>>Also while serializing to CVSL we want ONLY the header name
You can update the code which collect data in any necessary way, based on the used format of data in header
It is controlled by line 121 in dhtmlxgrid_nxml.js
    a.push((b[i].firstChild.tagName?b[i].firstChild:b[i]).innerHTML);

>>we want the users to be able to change the Column Header text
    grid provides onHeaderClick event, so you can use it to show some custom dialog for column text changing, and change text of header by js API