-
16 Jan 2012 7:07 PM #1
Its.grid.feature.Sorting
Its.grid.feature.Sorting
Hi all,
I've developed Its.grid.feature.Sorting that allows to multi-sort from grid interface. Here are some features:- Toggle between single sort and multi-sort mode (default).
- Allow setting the order of sorting (in case of multi-sort mode) by the order of columns (default) or by order of adding sort.
- In multi-sort mode, the sort will be updated in the following cases:
- Change the order of columns by dragging
- Add or remove a column from sort
- Add a column to sort by clicking its title or select items from grid column menu.
- Remove a column from sort by clicking its title (in case column.sortStates >= 3) or selecting an item on the grid column menu.
- Remove all columns from sort by selecting an item on the grid column menu.
Screenshot of grid column menu
grid-sorting.jpg
Source code
Its.grid.feature.Sorting.zip
-
16 Jan 2012 9:11 PM #2Sencha - Senior Forum Manager
- Join Date
- Mar 2007
- Location
- St. Louis, MO
- Posts
- 34,107
- Vote Rating
- 453
Very nice!
Mitchell Simoens @SenchaMitch
Sencha Inc, Senior Forum Manager
________________
http://www.JSONPLint.com - Source to lint your JSONP!
Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
https://github.com/mitchellsimoens
Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/
Need more help with your app? Hire Sencha Services services@sencha.com
Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is almost in print!
When posting code, please use BBCode's CODE tags.
-
17 Jan 2012 12:49 AM #3
-
20 Jan 2012 6:12 AM #4
-
18 Dec 2012 1:29 PM #5Sencha - Sales Team
- Join Date
- Mar 2007
- Location
- Melbourne, Australia (aka GMT+10)
- Posts
- 753
- Vote Rating
- 6
nice one
Sencha Technical Sales & Senior Technical Trainer
Sencha Inc
Register with discount code "ASA357" and save $100

The new SenchaWorld.com is coming in July, more details closer to SenchaCon
Code Validation : JSLint | JSONLint | JSONPLint
-
8 Jan 2013 2:43 AM #6
Hi,
It seems a very nice feature. Something that I've been looking for but unfortunately I couldn't make it work on ext-4.2.0-beta. Probably because of the changes in this new version.
First I couldn't get the feature to be inited at all then I examined the code like all other grid features it didn't have an init function to initialize and attach events. I've added an init function calling the attachEvents function inside it and it finally started to appear functioning
Then I realized it started to clear my initial sorters and I've changed the "else if (dir == null)" as else "if (dir === null)" in doSort function.
And at the end I found that when the Container's setSortState is called, it sets the sortState just for the first column as shown below:
So at the end I couldn't make a multiple sort configuration on my store to appear with the feature.Code:setSortState: function(){ var store = this.up('[store]').store, // grab the first sorter, since there may also be groupers // in this collection first = store.getFirstSorter(), hd; if (first) { hd = this.down('gridcolumn[dataIndex=' + first.property +']'); if (hd) { hd.setSortState(first.direction, false, true); } } else { this.clearOtherSortStates(null); } },
I hope you find the time to revise this necessary feature to overcome these problems.
Thanks in advance
Ipek


Reply With Quote




