I have 3 heanders, 1 setHeader and 2 attachHeader, in the attachHeader , i have 2 #rspan for the first column.
mygrid.setHeader(“
a
,
2009
,
2010
”>;
mygrid.attachHeader("#rspan,
d
,
e
">;
mygrid.attachHeader("#rspan,
f
,
g
">;
then i want change the values of headers, so i remove all the headers and add the new headers.
when i called mygrid.detachHeader(0), it worked for others columns, but not for the first column.
can u tel me the problem ? or can i change the values of headers directly ?
I just encountered the same issue myself. Weird that.
I tracked it down to the “rowspan” on the HTML table header still being enabled (which is what implements the #rspan).
I couldn’t find anything within the grid API to reset it so I resorted to some Javascript.
I used JQuery to find all the TD tags for the table with HDR class and set all of their rowspan attributes to 1.
The code was $(‘table.hdr td’).attr(‘rowSpan’,1);
Unfortunately I don’t think that will work when there are two or more grids on the same page. Some other HTML selection path criteria will have to be devised for that case (until the bug is fixed obviously!).
then i want change the values of headers
Do you need to change only values or structure as well?
In case data only modification, you can assign ID to columns and access them directly through DOM
mygrid.attachHeader("#rspan,<div id='label12'>d</div>, <div>e</div>">;
...
document.getElementById("label12").innerHTML = "new value";