How to paginate data in a Datagrid

The pagination is an important feature which is required in most of the applications and in a flex application we find it difficult to implement as it is some what different from other technologies. You can use the below solution provide as an example to be used in your applications.

In Flex, by default a DataGrid will display all rows in the data provider. If you have many rows of data then displaying few rows at a time to the user will give a good experience to the user.

The solution may be to make DataGrid display all rows in the data provider and you can split the data and update the data provider with required rows.

Explanation

DataGrid displays all rows in the data provider provided. If you have many rows of data then displaying few rows at a time to the user will give a good experience to the user.

As the DataGrid will display all the rows in the data provider, you can split the data and set the data provider of the DataGrid with only the required rows. To achieve this you will have to do simple calculation and split the data from the full data.

Please look at a good example on how to achieve this and blogged about it. Please find the source code and the sample implementation at the URL below.

http://gurufaction.blogspot.com/2007/02/flex-datagrid-paging-example-with.html

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s