I am trying to use TreeGrid's load on demand functionality as described here http://www.igniteui.com/tree-grid/load-on-demand
When the data source is set to a URL, it seems that my only option to pass some data to the server when a node is expanded is to rely on the autogenerated 'path' URL parameter, which lists a chain of row IDs up to the root, and also the node depth URL parameter. Is there any way to add any custom data to these calls besides what the widget does automatically? The data we are displaying is not homogeneous, so row IDs and depths are not sufficient when loading child rows.
Thank you!
Hello,
Thank you for contacting Infragistics!
If you use the igTreeHierarchicalDataSource you can use a customEncodeURlFunc to setup a custom call:
http://help.infragistics.com/jQuery/2015.2/ig.treehierarchicaldatasource#options:settings.treeDS.customEncodeUrlFunc
Hi Mike,
Thank you for pointing that object out. But how do I use it with TreeGrid? I tried something like that, and no call to the server occurs:
var ds = new $.ig.TreeHierarchicalDataSource({ treeDS: { dataSourceUrl: '/Home/GetTreeDataPlain', childDataKey: 'Employees' } }); $treegrid.igTreeGrid({ dataSource: ds, ... }); ds.dataBind();
Note that I got the same TreeGrid working with the following code:
$treegrid.igTreeGrid({ dataSource: '/Home/GetTreeDataPlain', childDataKey: 'Employees', ... });
Thanks again!
Thank you for the update. Do you get any errors with the datasource? What is in the browser console? What version are you using?
Mike,
I am using the latest IgniteUI 2015.2 and Google Chrome. No errors in the console. Is the syntax that I am using correct? I could not find any samples like this, though.
(I am not Vishvas, though :))
From what you have provided the syntax appears to be correct. Would you be able to send me your code for the entire page so I can take a look at it and see what is going on? Do you have an isolated sample?