PDA

View Full Version : Problem: sorting DataGrid using dispatchEvent



project6
October 18th, 2007, 03:06 PM
Hi.

I'm using a hidden column with various IDs that I want to be able to sort my datagrid with.
For this I'm using two RadioButtons. (one for default sort by name, and the other sorts by the hidden column)

The radiobuttons have eventlisteners that triggers when clicked, these work fine.

The problem I have is with my dispatchEvent.

I have created a DataGridEvent with all the parameters, and use dispatchEvent to trigger it. Nothing happens, although If I understood this right this would simulate a click on one of the column headers (as you would sort it normally)

This code is placed within the function that the radiobuttons call when they're clicked.
dg is my datagrid.



var v:DataGridEvent = new DataGridEvent(DataGridEvent.HEADER_RELEASE, false, false, 0, 0, null, null, null);
dg.dispatchEvent(v);
trace("TEST");


I get TEST as output so I know it's running through... the DataGrid doesn't change sort column tho... Help! :angel:

/p6

EDIT: SOLVED! I simply sorted the dataprovider... *sigh* I'm so stupid ;)