Initializing through XML

I’m having trouble initializing grid column headers through the XML - Doesn’t this feature work anymore?

I have no problems building XML where the rows section only contain data rows, but everytime I attempt to also add the column header to the XML it fails.

Works:

<rows> <row> <cell>data-A</cell> <cell>data-B</cell> <cell>data-C</cell> <row> </rows>

Doesn’t work:

<rows> <head> <column>column-header-A</column> <column>column-header-B</column> <column>column-header-C</column> </head> <row> <cell>data-A</cell><cell>data-B</cell><cell>data-C</cell> <row> </rows>

According to this http://docs.dhtmlx.com/doku.php?id=dhtmlxgrid:storing_additional_data the above approach should work.

Why doesn’t it?

/Aidal

Really, nobody can answer these 2 questions?

Never mind, I finally found the solution, but for anyone else having the same problem…

Yes, it still works to configure columns through the xml.

And the reason it didn’t work for me was because I was calling grid.init() which apparently you shouldn’t when configuring the grid through the xml.
http://docs.dhtmlx.com/doku.php?id=dhtmlxgrid:configuration_from_xml

Just instantiate the grid, set the image path and do grid.parse() or grid.load().

Hope that helps :wink:

/Aidal