:: Forum >>

Multi Column Sorting

Hi,

I know this is not supported by default.

My requirement is that grid should show data sorted on multiple columns when -
1) grid gets loaded first time (based on default settings)
2) also user can change settings (different set of columns for sorting) on the screen after grid was already loaded, following which grid should refresh based on new (multi column) sort settings.

I know I can do a round trip to server to achieve this using SQL but I do not want to do that for some reasons (obviously for performance, user experience reasons). Now how should I do it on client side using javascript so that it gels with AW Grid scheme of things.

I have some initial thoughts. Experts please validate or share better approaches.
I guess I will have to maintain a dummy hidden/zero width column whose cells will contain concatenated values for the values in the cells of columns to be sorted like colAvalue-colBvalue-colCvalue.Then I will write a custom sort function which will sort on the basis of this column taking into account individual column types/formats (string,number,date etc) and also order requested on individual columns (ascending-descending-ascending etc.).

Now my queries -
-Where should I be writing this custom script. In a custom comparator, sort function or any other AW widget concept/construct.Please suggest I am new to AW
- What I want is that when/if user click on grid header the default individual column sorting should continue to work.Please suggest how I should take this into account in my custom script.
- I would also like take advantage existing sort functions that might be existing in AW codebase for things like string,number,floating numbers,date etc. rather then rewriting them.
- Is it possible to have a hidden/zero width column.
- Please can somebody share a sample code for this


Regards,
Girish
Girish Khemani, Fidelity India
Tuesday, July 18, 2006

This topic is archived.


Back to support forum

Forum search