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

Server Side Paging

First off, I really like the ej2 treegrid capability to page based off of child nodes, and not just root nodes. This is because my company's trees are very, very child heavy, but not very node heavy (i.e. <10 levels deep tree, but each node could have thousands of children).

My question is, has anyone had success using server-side paging with the treegrid? Obviously with trees that large it is not feasible to have it all in the browser, but I don't see any way within the component to tell it that this dataset is just a small set of the tree (so it can maintain its indentation), or any information to tell the backend like "I just showed the first 5 children of node x, give me the next 20 things that come next).

On the docs page (https://ej2.syncfusion.com/angular/documentation/tree-grid/paging/) it says You can achieve better performance by using treegrid paging to fetch only a pre-defined number of records from the data source. so I'm just wondering what tools the component gives to do this.

Thanks!

1 Reply

VN Vignesh Natarajan Syncfusion Team January 25, 2019 12:35 PM UTC

Hi Daniel, 

Thanks for contacting Syncfusion support. 

Query: On the docs page (https://ej2.syncfusion.com/angular/documentation/tree-grid/paging/) it says You can achieve better performance by using treegrid paging to fetch only a pre-defined number of records from the data source 

For remote data binding and it’s features we suggest you to refer the below documentation. 


When paging is enabled and remote data is bounded to TreeGrid, records will be fetched from the server as whole and based on the current page size. On expanding the child record, post will be sent to server to fetch child record and display the child records according to page size. Remaining data’s can viewed by navigating to next pages.    

Query : my company's trees are very, very child heavy, but not very node heavy (i.e. <10 levels deep tree, but each node could have thousands of children). 
 
Even if you have thousands of children for a parent element. We will fetch the child records based on the immediate parent node from the server and cached locally, only when the expand icon of the parent record is clicked. So, overall performance of the TreeGrid will not be affected even if there are more number of children for a parent record. 

Query : but I don't see any way within the component to tell it that this dataset is just a small set of the tree (so it can maintain its indentation), or any information to tell the backend like "I just showed the first 5 children of node x, give me the next 20 things that come next). 
 
According to this query we suspect that you want to get the count of the child records. We can get the count of the children for a parent only after rendering the child records of that parent. So, it is not feasible to get the record count before rendering the child records of a parent node. 

If we misunderstood any of your queries or if you need any furthermore assistance please get back to us. We will be happy to assist you. 

Regards, 
Vignesh Natarajan 
 


Loader.
Live Chat Icon For mobile
Up arrow icon