If you set the sort with only one sortField, the DG should reflect that.
Maybe you can post a test case?

________________________________

From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of ruidsoares
Sent: Wednesday, November 28, 2007 7:59 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] How to remove the current sort on a Datagrid



Hi,

I have a Datagrid that the user is able to edit directly. He is also
allowed to add a new item 
in the grid. This is done by using addItem on the ArrayCollection that
serves as the data 
provider for the grid. After that I use the editedField method of the
datagrid to give focus 
to the first column of the newly created line so that the user is able
to insert the 
information right away. I use as rowIndex the dataProviders length - 1.

The problem is that when the grid is sorted by one of its three columns
the 
dataProvider.lemgth - 1 no longer points to the inserted row. I
successfully resorted the 
dataProvider using a new field with sequential number and replacing the
sort on the 
ArrayCollection with a new one that uses this new field. So, the
dataProvider.length - 1 
points to the last row (just inserted). The new column is not displayed,
it's just there for 
control.

The problem now is that the DataGrid still displays the arrow on the
column by which it 
was last sorted effectively deceiving the user into thinking that the
sort has not changed.

Does anyone know how to solve this?

Thanks



 

Reply via email to