0
votes

I am new to AS3 FLASH. Can any one help/guide/or provided a link for, HOW TO CREATE DATAGRID with paging. I have successfully create datagrid and fill dynamically from database using php. I have more than 600 records and want to show 100 records in grid and show paging bellow it with next , previous option.

this is my code.every thing is working fine. I want add paging it.

for (varName in returnObj) {
var plid                = int   (returnObj[varName]["plid"]);
var varState            = String(returnObj[varName]["state"]);
var varCity             = String(returnObj[varName]["city"]);

arrDP.push({        //arrDP is array defined
    //Column          Value
    Select          : plid, 
    State           : varState,
    City            : varCity
});

var dp:DataProvider              = new DataProvider(arrDP);
var select:DataGridColumn        = dg.addColumn("Select");
var state :DataGridColumn        = dg.addColumn("State");
var city  :DataGridColumn        = dg.addColumn("City");    
dg.dataProvider                  = dp; //dg IS DATAGRID NAME AND dp IS DATAPROVIDER
}

in short i need some thing like in link below. http://www.iamboredsoiblog.eu/2009/01/10/advanced-paging-and-filtering-in-flex-datagrid/

1
Why? Scrolling through the data is much easier for the user than clicking on little numbers that don't tell where they will lead him. IMO pagination is an HTML concept that dates from the time that performance was an issue when working with 100 records. In Flex you can load tens of thousands of records in seconds without a problem.RIAstar
Thanks for reply.your rigfht. but it's my client requirement.for now there is 600 records which can be more and more in future.faizi

1 Answers

0
votes

Have your PHP query with a 'limit [start],[length]' on it. Put buttons on the bottom of your datagrid to requery with the appropriate starting point for the next query.

Also - I've found that trying to read in more than more than a few hundred records really slows down the rendering in my Flex apps. Esp if you are asking for a sort or drawing any sort of custom controls. That's just my $0.10 though. YMMV.