I'm using LCDS Paging with large datasets. In the headerRelease event 
handler, I'm requerying the server to reorder the dataprovider and 
calling event.preventDefault() to bypass DataGrid's own sorting logic--
which needless to say is useless for moderate to large datasets when 
paging.

But calling event.preventDefault() prevents updating the column header 
to include the appropriate sorting direction indicator (icon).

Since I want to use default sorting for smaller datasets, and requery 
the server for larger datasets, I need to leverage the sort icon in the 
column header using DataGrid's mechanism if at all possible or else 
I'll have to override other events that affect the sort direction icon 
in the header as well and develop a complicated bit of state management.

I started down the subclassing road, but quickly discovered DataGrid 
was never designed for extension (most members are private) and I need 
to update lastSortIndex and sortIndex before calling placeSortArrow(), 
but lastSortIndex and sortIndex are private!

I've read some related posts, but none that suggests a solution to my 
problem beyond modifying Flex mx sources, or copying and pasting the 
DataGrid class--neither of which are acceptable to me.

Correct me if I'm wrong, but it appears my only chance is to render the 
sort direction icon in the column header myself and maintain my own 
sorting index and direction state. But doing this means I cannot use 
default sorting or my state will be out of sync with DataGrid's state. 
It wil take a lot of work to determine what other events can affect the 
sort direction icon in headers and override those as well just to keep 
the state synchronized.

Anyway, does anyone know of an example of a custom renderer for column 
headers that includes the sort direction icon? Or am I missing 
something and there is a public (or protected) method that will allow 
me to update the sort index members and call placeSortArrow()?

Thanks in advance!

Erik

Reply via email to