I want to load my grid with an in-memory javascript array of objects.
I am using the grid’s parse method to do so, but no data appears, I am guessing because there is not a one to one mapping between the object properties and the columns that I have defined using setHeader.
I do not wish to display all properties and do not have control over the format of the data.
So can someone point me to information as to how/where I can define a mapping between the properties in the array and the columns defined in the grid.
Thanks for the very quick reply, unfortunately I didn’t set the notify me checkbox, so I am only seeing this now.
I have added the setColumnsId statement but it didnt help.
On studying your examples I see the issue.
lets step back a little, I am evaluating javascript grids, I have looked at kendoUI, infragistics, ng-grid, jqwidgets, jqgrid and all of them have accepted the javascript array that I am supplying to dhtmlx. But I on studying your examples I see that your javascript array is expected to be
Where data: is an array object of key/value pairs; and
Where head: in an array object of key/value pairs where the following keys are reserved for DHTMLX’s header settings
id: the key in data: where this column should get the value from
value: header column name
type: dhtmlxgrid type, e.g., ed, ch…
sort: dhtmlx sort types
align: left, right…
width: otherwise… it will really default to 100 even if you have setInitWidths as having different values…
Interesting that this method works and the other one with setColumnIDs did not work.
Bummer but I can live with it since we do not have a dynamic requirement to set Header Properties and Values in runtime…