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 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,556
    Answers
    3931
    Vote Rating
    1272
      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! 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 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,556
    Answers
    3931
    Vote Rating
    1272
      0  

    Default

    The column should reflect the store sorting state.
    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

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
  •