The Story

I am paging a heavily rendered datagrid using this method.

 

http://www.brucephillips.name/blog/index.cfm/2006/11/29/Paging-Using-Next--P
revious-Through-Records-Displayed-In-A-Flex-DataGrid

 

Essentially, it is operates by slicing a small array out of a master array
and then setting the sliced array as the dataprovider for the grid. When a
new 'page' is needed, then the array is re-sliced and the new sliced array
is set as the dataprovider. This part works fantastic but the problem is
that I now need to introduce sort functionality to the datagrid via a drop
down box. I first set it up to sort the sliced array with no problems but it
was pointed out that this is not entirely intuitive to the user to only sort
20 records instead of all the records. 

 

The Problem

When I apply the sort to the master array and then slice it, I do not get
sorted results in the sliced array. My presumption is that a sort does not
actually change the order of an array but rather has another mechanism to
dictate the order in which it is displayed. I need to be able to sort the
master array from newest to oldest and when I slice the first 20 records;
they are the 20 newest records from the master array.

 

I appreciate the help and thanks!

 

Lukas Ruebbelke

Reply via email to