views:

232

answers:

1

I have an AdvancedDataGrid that I allow the user to drag/drog the rows to reorder them and also allow them to sort on columns. I want to save the row ordering so that the next time I load up the data, the row ordering is preserved.

I have a bindable array collection to the data grid. The array is a collection of a custom AS object. I tried just using the bindabled array collection I give to the datagrid but the order always stays the same.

thanks.

A: 

Hi Bryant,

you'll need to add a 'sortOrder' member field to the custom AS object you're using. When the user sorts when dragging, you can update the sortOrder variable.

Also, your ArrayCollection will have to have a SortFunction added to it. (myAc.sort = mySortFunction). This SortFunction will use SortField to sort on 'sortOrder' (numerically).

That should be enough to get you going :-)

bjornbjorn