# Angular TreeList Manual Paging

The manual paging gives the developer full control over how children are fetched and how the tree structure is built.

Compared to [paging with the built-in directives](https://www.telerik.com/kendo-angular-ui/components/treelist/paging/basics#automatic-data-processing), the manual approach requires you to define the child-fetching logic explicitly. It is especially useful for lazy-loading children on demand or filtering child nodes before they are displayed.

To enable manual paging:

1. Bind root-level records to the [`data`](https://www.telerik.com/kendo-angular-ui/components/treelist/api/treelistcomponent#data) property.
2. Set the [`fetchChildren`](https://www.telerik.com/kendo-angular-ui/components/treelist/api/treelistcomponent#fetchchildren) callback to return the children of a given node.
3. Set the [`hasChildren`](https://www.telerik.com/kendo-angular-ui/components/treelist/api/treelistcomponent#haschildren) callback to indicate whether a node has children.
4. Set the [`pageable`](https://www.telerik.com/kendo-angular-ui/components/treelist/api/treelistcomponent#pageable) option to `true`.
5. Define the number of records per page by setting the [`pageSize`](https://www.telerik.com/kendo-angular-ui/components/treelist/api/treelistcomponent#pagesize) property.
6. Handle the [`pageChange`](https://www.telerik.com/kendo-angular-ui/components/treelist/api/treelistcomponent#pagechange) event to react when the user navigates to a different page. This is required when paging data on the server so that you can capture the current `skip` and `take` values and pass them to the server.

## Paging Local Data

To paginate local data, filter the source array inside the `fetchChildren` callback to return the children for the expanded node.

> When other data operations like sorting or filtering are also enabled, handle them within your `fetchChildren` callback before returning the result. For more details, refer to [Data Operations](https://www.telerik.com/kendo-angular-ui/components/treelist/data-operations#handling-multiple-data-operations).

The following example demonstrates the manual paging approach with a hospital organizational hierarchy.

[Demo Source](https://demos.telerik.com/kendo-angular-ui/demos/treelist/paging/manual-paging/source.txt)

## Paging on the Server

To paginate data from a remote source, handle the [`pageChange`](https://www.telerik.com/kendo-angular-ui/components/treelist/api/treelistcomponent#pagechange) event to capture the current paging state, then use the [`fetchChildren`](https://www.telerik.com/kendo-angular-ui/components/treelist/api/treelistcomponent#fetchchildren) callback to send a request to the server and return an `Observable<T[]>`. For more details, refer to [Processing Data on the Server](https://www.telerik.com/kendo-angular-ui/components/treelist/data-operations#processing-data-on-the-server).

## Suggested Links

* [Automatic Paging](https://www.telerik.com/kendo-angular-ui/components/treelist/paging/basics)
* [Data Operations](https://www.telerik.com/kendo-angular-ui/components/treelist/data-operations)
* [Pager Settings](https://www.telerik.com/kendo-angular-ui/components/treelist/paging/pager-settings)
* [Pager Template](https://www.telerik.com/kendo-angular-ui/components/treelist/paging/pager-template)
* [API Reference of the TreeListComponent](https://www.telerik.com/kendo-angular-ui/components/treelist/api/treelistcomponent)
* [API Index of the TreeList](https://www.telerik.com/kendo-angular-ui/components/treelist/api)
