AS3 datagrid with pagination <previous 1 2 3 4 5 Next>
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/
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.
精彩评论