Results 1 to 5 of 5

Thread: ExtJS 6.2.1 Classic: Grid MultiColumnSort=true - How to revert to no sort ?

  1. #1
    Sencha Premium User
    Join Date
    Jun 2011
    Location
    Perth, Western Australia
    Posts
    182
    Answers
    10

    Default Answered: ExtJS 6.2.1 Classic: Grid MultiColumnSort=true - How to revert to no sort ?

    With MultiColumnSort = true, I can't find an option to set sorting "off" on a column once it's been switched on (i.e. at runtime)
    But when a user chooses to sort either ascending or descending on one column, then change their mind & want to stop sorting by that column and start sorting by another, it seems they're stuck.

    The only way I can advise users is to leave that screen/grid and come back again.

    Have I missed something or is this the way it is?

  2. I have found the answer ... a much better solution than the one I was pursuing

    This forum thread from 2015. Thanks Joel Watson.

  3. #2
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,256
    Answers
    759

    Default

    What are you suggesting the behaviour should be? I'm not really clear on what you're asking.
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  4. #3
    Sencha Premium User evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    19,256
    Answers
    759

    Default

    But what would the no sort option do? Would it just remove the indicator from the column?
    Twitter - @evantrimboli
    Former Sencha framework engineer, available for consulting.
    As of 2017-09-22 I am not employed by Sencha, all subsequent posts are my own and do not represent Sencha in any way.

  5. #4
    Sencha Premium User
    Join Date
    Jun 2011
    Location
    Perth, Western Australia
    Posts
    182
    Answers
    10

    Default

    OK I have now discovered that I am extending a 3rd party "ExportableGrid" that has "multiColumnSort": true

    This is a great feature & with remoteSort: true, it sends a JSON sort object to a web service .. all good stuff
    It says in the Docs that the last column you click becomes the primary sort column. That's OK also and this info can be conveyed to users to stop the current confusion.

    The only problem I have is: you can't seem to switch sorting off on a column once you have switched it on... meaning, the user can't change their mind.

    Using the grids on sort change event I am able to set a "Cancel Sorting" button to become enabled / disabled depending on the number of "sorts" on a store
    ... But I need help with the 'Cancel Sort' logic ... How should I a) remove the sorters & b) hide the "arrow" buttons on the column headers?

    Code:
    onSortChange: function(){
             var me = this,
                   store = me.grid.store,
                   cancelSortBtn = me.lookupReference('btnCancelSort'),
                   sortCount = store.sorters.length;
             cancelSortBtn.setDisabled(sortCount == 0);
    },
    onCancelSort: function(){
         var me = this,
               store = me.grid.store,
               sorters = store.getSorters();
    // What to do here .. ? 
         Ext.each(sorters.items, function(sort){
                sort.destroy(); <<< ????? 
         })
    }

  6. #5
    Sencha Premium User
    Join Date
    Jun 2011
    Location
    Perth, Western Australia
    Posts
    182
    Answers
    10

    Default

    I have found the answer ... a much better solution than the one I was pursuing

    This forum thread from 2015. Thanks Joel Watson.

Similar Threads

  1. Replies: 2
    Last Post: 6 Jan 2017, 3:51 PM
  2. Replies: 1
    Last Post: 16 Apr 2015, 9:31 PM

Posting Permissions

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