Results 1 to 3 of 3

Thread: grid setSortable modern

  1. #1
    Sencha User
    Join Date
    Apr 2014
    Posts
    110

    Default grid setSortable modern

    Hey together,

    I want to change the sortable attribute of my grid by a userinteraction, but it is not working. A refresh also dosen't help.
    What do I have to do that the buttons work?

    https://fiddle.sencha.com/#view/editor&fiddle/36ko


    Thanks for your help!

  2. #2
    Sencha User ArthurRubens's Avatar
    Join Date
    Jan 2019
    Location
    München
    Posts
    4

    Default

    Looks like to be bug, but you can do the following:

    Code:
    ...
    items: [{
                    docked: 'top',
                    items: [{
                        xtype: 'button',
                        height: 30,
                        width: 200,
                        text: 'Disable sorter',
                        handler: function () {
                            var grid = this.up("grid");
                            grid.getHeaderContainer().setSortable(false);
                        }
                    }, {
                        xtype: 'button',
                        height: 30,
                        width: 200,
                        text: 'Enable sorter',
                        handler: function () {
                            var grid = this.up("grid");
                            grid.getHeaderContainer().setSortable(true);
                        }
                    }]
                }]
    ...
    "The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague." – Edsger W. Dijkstra


  3. #3
    Sencha User
    Join Date
    Apr 2014
    Posts
    110

    Default

    Thank you that is the solution I was hoping for! I would never have found this solution myself!

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
  •