Hi
I am trying to set the column format in the hierarchical grid but I fail to get the format to apply and I do not get any error messages explaining what I am doing wrong. The following is a snipplet of my code.
Best Regards
Fredrik
var jsonSchema = new $.ig.DataSchema("json", { fields: [topLevel.metaData.fields] });
module.setDataSource = function (data, tableId, jsonSchema ) { $("#" + tableId).igHierarchicalGrid({ width: "100%", dataSource: data, animationDuration: 100, dataRendering: module.hierarchicalGridRendering,schema: jsonSchema , features: [ { name: 'Paging', type: "local", showPageSizeDropDown: false, pageSize: 80 }, { name: "Resizing" } ], autoGenerateLayouts: true }); };
Where the json structure looks something like this:
topLevelMetaData { schema { fields[0] { {name: someName, type: someType}, ..., {name: someName, type: someType}}}}
Hello Fredrik,
Thank you for posting in our forum.
You can refer to the following article from our documentation that explains how the column and layouts have to be set:
http://help.infragistics.com/doc/jQuery/2013.2/CLR4.0/?page=igHierarchicalGrid_Columns_and_Layouts.html
What seems to be missing in your example is the childrenDataProperty for the main grid which should correspond to the property name from which the child data should be retrieved from.
Also responseDataKey and searchField are used when your json data is wrapped in another object. For example:
var adventureWorks = {
"Records": [{
"ProductID": 1,
"Name": "Adjustable Race",
"ProductNumber": "AR-5381"
}, {
"ProductID": 2,
"Name": "Bearing Ball",
"ProductNumber": "BA-8327"
}
]};
In the upper example the data is wrapped in an object “Records”.
In that case it’s necessary to set the responseDataKey and searchField in order for the grid to know form which object to get its data. Otherwise they should be empty.
I’ve attached an example for your reference. Let me know if you have any questions.
Best Regards,
Maya Kirova
Developer Support Engineer II
Infragistics, Inc.
http://es.infragistics.com/support
Hi again Maya,
I managed to fix the issues I were having and now the grid is rendering correctly. Thank you for the instructive example.
I have one more question though. How do you applay templates to the hierarchical grid. Do you set a template variable in the columnLayout on the specific column?
Hello Fredrik ,
I’m just following up to see if you’ve been able to resolve your issue. If you have any questions or concerns or if you need further assistance please let me know.
Developer Support Engineer