Hi Andras,
Thanks for contacting Syncfusion Forums.
QUERY: On demand loading
From your query we understand that, you need to use “on demand loading of remote data’. For using on demand loading, there is no need to enable any specific property. You just need to specify the type of adaptor you are using and the URL link.
But simply referring URL to TreeGrid DataManager would require two ajax posts. So to optimize it we need to set an optional property called “HasChildMapping“. Every record has a Boolean field that denotes whether it is a parent record. We need to map that field name to “HasChildMapping” property. Please refer following code example.
<ejs-treegrid id="TreeGrid" idMapping="TaskID" height="260" parentIdMapping="ParentItem" hasChildMapping="isParent" treeColumnIndex="1">
<e-treegrid-columns>
-----------
</e-treegrid-columns>
</ejs-treegrid>
Example Data Source,
Parent Data:
{"TaskID":1, // idMapping "TaskName":"Parent Task 1", "StartDate":"1992-06-07T00:00:00", "Progress":"In Progress", "Priority":"Critical”, "ParentItem":null, // parentIdMapping "isParent":true // hasChildMapping property },Child Data: {"TaskID":3, // idMapping "TaskName":"Child Task 3", "StartDate":"1992-06-07T00:00:00", "Progress":"Validated", "Priority":"Critical", "ParentItem":1, // parentIdMapping "isParent":false // hasChildMapping property }
|
Please refer the below link for understanding HasChildMapping property,
Please refer the below help documentation,
Also you can refer below demo sample for remote data,
If you have further queries, please get back to us.
Regards,
Padmavathy Kamalanathan