1. #1
    Sencha - Community Support Team
    Join Date
    Jan 2012
    Posts
    1,376
    Vote Rating
    103
    vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all vietits is a name known to all

      1  

    Default 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.
    Hope that this is useful to you. Any feedback will be welcome!

    Screenshot of grid column menu
    grid-sorting.jpg

    Source code
    Its.grid.feature.Sorting.zip

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    St. Louis, MO
    Posts
    34,107
    Vote Rating
    453
    mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of mitchellsimoens has much to be proud of

      0  

    Default


    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.

  3. #3
    Sencha User ajaxvador's Avatar
    Join Date
    Nov 2007
    Location
    PARIS, FRANCE
    Posts
    204
    Vote Rating
    0
    ajaxvador is on a distinguished road

      0  

    Default +1

    +1


    +1
    Vador

  4. #4
    Sencha User
    Join Date
    Nov 2007
    Posts
    31
    Vote Rating
    0
    zacware is on a distinguished road

      0  

    Default


    Great! Thanks! Just what I was looking for!

  5. #5
    Sencha - Sales Team dawesi's Avatar
    Join Date
    Mar 2007
    Location
    Melbourne, Australia (aka GMT+10)
    Posts
    753
    Vote Rating
    6
    dawesi will become famous soon enough

      0  

    Default


    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

  6. #6
    Ext JS Premium Member canxss's Avatar
    Join Date
    Sep 2008
    Posts
    170
    Vote Rating
    2
    canxss is on a distinguished road

      0  

    Default


    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:

    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);
            }
        },
    So at the end I couldn't make a multiple sort configuration on my store to appear with the feature.

    I hope you find the time to revise this necessary feature to overcome these problems.

    Thanks in advance

    Ipek