We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

On demand loading

This page of the documentation states that the TreeGrid component is capable of "on demand" loading of remote data:


Quote: "The TreeGrid provides Load on Demand support for rendering remote data."

I'm unable to use this feature. I tried to find this property in the javascript source (ej2.min.js), but it's not in there. My question is: is this functionality not implemented, or am I missing something?

1 Reply

PK Padmavathy Kamalanathan Syncfusion Team June 24, 2019 12:16 PM UTC

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-data-manager url="https://ej2services.syncfusion.com/production/web-services/api/SelfReferenceData" adaptor="WebApiAdaptor" crossDomain="true"></e-data-manager> 

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. 

Padmavathy Kamalanathan 

Live Chat Icon For mobile
Up arrow icon