Load More Button
The TreeView enables you to display only a limited number of nodes in each level, when the provided data set is too big.
The following example demonstrates how to limit the number of displayed nodes when all the available data is loaded into the TreeView.
kendoTreeViewLoadMore directive can be configured to fetch the new nodes on demand from the server.
To achieve the aforementioned result, the following configuration data has to be provided:
kendoTreeViewLoadMore- The directive selector is also an input for a function that acquires new child nodes. It is called each time a Load more button is pressed. The function receives a
LoadMoreRequestArgsobject as a single parameter.
pageSize- The initial page size for the each level.
totalField- The field that holds the information how many children in total the node has.
totalRootNodes- As the root level nodes are not associated with any parent node, the total number of root nodes has to be provided exclusively.
The page size for each data item children group is initially set through the
property of the
kendoTreeViewLoadMore directive. It can, however, be read and manually
changed for any node through the TreeView
The Load more button can be fully customized according to the application needs by using the