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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

On demand loading

Thread ID:

Created:

Updated:

Platform:

Replies:

145436 Jun 21,2019 04:07 PM UTC Jun 24,2019 12:16 PM UTC ASP.NET Core - EJ 2 1
loading
Tags: Tree Grid
András
Asked On June 21, 2019 04:07 PM UTC

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

https://ej2.syncfusion.com/aspnetcore/documentation/tree-grid/data-binding-core/?no-cache=1

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?

Padmavathy Kamalanathan [Syncfusion]
Replied On 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> 
  <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 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon