Results 1 to 4 of 4

Thread: update column header style on grid sorting

  1. #1
    Sencha User
    Join Date
    Oct 2010
    Posts
    6
    Vote Rating
    0
      0  

    Arrow Unanswered: update column header style on grid sorting

    I have a 'reset sorting' button in toolbar in my grid so there is ability to explicitly revert to default sorting. there is following click handler function on the button:

    onResetSorter: function() {
    this.getStore().sort({
    property: 'id',
    direction: 'DESC'
    });
    }

    this sorts related store and refreshes grid body accordingly, but does NOT update style for column heading with the highlighted background and arrow. any ideas?

    thanks

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,422
    Answers
    3901
    Vote Rating
    1271
      0  

    Default

    The datachanged event will fire when the store is sorted. The data property of the Store is an instance of Ext.util.MixedCollection which fires a sort event, wish that was bubbled to the Store but you could listen for it. I would just stick with datachanged event and see if the Store is sorted and enable/disable or hide/show the button to your liking.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    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 in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Sencha User
    Join Date
    Oct 2010
    Posts
    6
    Vote Rating
    0
      0  

    Default

    thanks Mitch. the problem is not in the button though neither in listening for the sorting event but how to set the default column visually active once the button is clicked (column header highlighted with blue background + corresponding arrow)?

  4. #4
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,422
    Answers
    3901
    Vote Rating
    1271
      0  

    Default

    The column should reflect the store sorting state.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    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 in print!

    When posting code, please use BBCode's CODE tags.

Tags for this Thread

Posting Permissions

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