Friday, October 29, 2010

Importing more than 10000 records in AdvancedDataGrid issue

Consider you are getting 10000 records from server side in the form of XML and you have to display those records in Client side i.e. Flex AdvancedDataGrid.

It has been very critical to load more than 10000 records in Advanced DataGrid, there are many works around to solve this issue, after some workaround I found one of the solutions to load huge amount of data.

Difficulty faced during Debug this issue: -
1) Flex timeout: while debugging for 10000 and more records on client side.

Solution: After research I came to know that Flex gives timeout error after 2500 - 2900 records has been added in ArrayCollection which lead to Flex Timeout error.

If you are trying to load more records you have to create recursive function to handle it on client side.

setTimeout(recursiveImportHandler,200)

In recursiveImportHandler() function put “count” as variable which will keep track of record no.. Use “for loop” to add record in ArrayCollection.

Make your ArrayCollection as Bindable

Note: Your “count” should not be greater than your imported XML length.

To avoid user click you can provide Progress bar till your data gets loaded in AdvancedDataGrid.

No comments:

Post a Comment