Results 1 to 6 of 6

Thread: Its.grid.feature.Sorting

  1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    1,376
    Vote Rating
    116
      1  

    Default 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 - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,551
    Vote Rating
    1271
      0  

    Default

    Very nice!
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it! Checkout the CODE tag!

    Check out my GitHub, lots of nice things for Ext JS and Sencha Touch
    https://github.com/mitchellsimoens

  3. #3
    Sencha Premium Member ajaxvador's Avatar
    Join Date
    Nov 2007
    Location
    PARIS, FRANCE
    Posts
    211
    Vote Rating
    0
      0  

    Default +1

    +1
    Vador

  4. #4
    Sencha User
    Join Date
    Nov 2007
    Posts
    31
    Vote Rating
    0
      0  

    Default

    Great! Thanks! Just what I was looking for!

  5. #5
    Sencha Premium Member dawesi's Avatar
    Join Date
    Mar 2007
    Location
    Melbourne, Australia (aka GMT+10)
    Posts
    1,093
    Vote Rating
    56
      0  

    Default

    nice one
    Lead Trainer / Sencha Specialist
    Community And Learning Systems

    Lead Architect
    DigitalTickets.net

  6. #6
    Ext JS Premium Member canxss's Avatar
    Join Date
    Sep 2008
    Posts
    190
    Vote Rating
    3
      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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •