Add a pagination to TreeGrid

Tutorial » Add a pagination to TreeGrid

This tutorial shows how to add a pagination to TreeGrid with dynamic loading feature.

Create TreeGrid

To enable paging feature for TreeGrid, the 'pagination:true' property should be added, Thus the 'page' and 'rows' parameters will be sent to server when loading a page.

The Server Code

treegrid4_getdata.php

The parameters sent to server include:

  • page: The current page to load.
  • rows: The page size.
  • id: The id value of parent row, the rows returned from server will be appended to.

When expanding a row node, the 'id' value is greater than 0. When changing the page number, the 'id' value should be set to 0 to prevent from loading children rows.

Download the EasyUI example:

easyui-treegrid-demo.zip