/*Method for Pagination */
private function navPage(searchList:ArrayCollection,
indexCount:int):void {
if (indexCount == 0)
index = 0;
else if (indexCount == -1) {
var tempIndex:int = searchList.length %
10;
index = tempIndex == 0 ?
searchList.length - 10 :
(searchList.length - tempIndex);
}
else
index += indexCount;
displaySearchResultList =
refreshDataProvider(searchList, index);
}
/*refresh the dataprvider to reflect the total pageno
in pagination
*/
private function
refreshDataProvider(searchList:ArrayCollection,
start:int):ArrayCollection {
var pageList:ArrayCollection;
if (strPaging.selected == true) {
index = start;
page = (searchList.length - start) > 10
? 10 : searchList.length
- start;
pageList = new
ArrayCollection(searchList.source.slice(start,start
+page));
}
else {
index = 0;
page = searchList.length;
pageList = new
ArrayCollection(searchList.source);
}
first.enabled = prev.enabled = index > 0;
last.enabled = next.enabled = index + page <
searchList.length;
lbl.text = index.toString() + ' to ' + (index +
page).toString() +
' of ' + searchList.length;
return pageList;
}
private function
togglePaging(searchList:ArrayCollection):void {
if (strPaging.selected == true) {
displaySearchResultList =
refreshDataProvider(searchList, index);
} else {
displaySearchResultList =
refreshDataProvider(searchList, 0);
}
}
On Feb 3, 12:56 am, Soumya Here <[email protected]> wrote:
> Hi all,
>
> I have a datagrid which needs two requirements.
> (1) Pagination on the datagrid
> and (2) In the datagrid one column header has a label as rendered iteam and
> it acts as a filter upon the column values.
>
> Please send me some code of a datagrid which can have both the above
> functionalities.
>
> Please help me out
>
> Thanks in advance,
>
> Thanks,
> Soumya
--
You received this message because you are subscribed to the Google Groups "Flex
India Community" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/flex_india?hl=en.