Check the master after sorting to make sure it is right. Slices taken after that should be as expected
________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Lukas Ruebbelke Sent: Friday, October 19, 2007 8:41 AM To: [email protected] Subject: [flexcoders] Sort a sliced array The Story I am paging a heavily rendered datagrid using this method. http://www.brucephillips.name/blog/index.cfm/2006/11/29/Paging-Using-Nex t--Previous-Through-Records-Displayed-In-A-Flex-DataGrid <http://www.brucephillips.name/blog/index.cfm/2006/11/29/Paging-Using-Ne xt--Previous-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

