1. #1
    Sencha Premium Member
    Join Date
    Oct 2012
    Posts
    6
    Answers
    2
    Vote Rating
    0
    remiszej is on a distinguished road

      0  

    Default Answered: grid column sort option greyed out

    Answered: grid column sort option greyed out


    I don't understand why the sort option for my grid columns is disabled (greyed out) although I use sortable : true configuration. Any help would be greatly appreciated.

    My grid with store and model are attached.
    Attached Files

  2. After some troubleshooting I found out that my problem was buffered configuration for the store.
    Once I removed that, column sorting is back.

  3. #2
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,085
    Answers
    675
    Vote Rating
    467
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Perhaps I missed something?

    Code:
    Ext.create('Ext.data.Store', {
        storeId : 'simpsonsStore',
        fields  : [
            {
                name : 'name', sortType : Ext.data.SortTypes.asUCString
            }, 
            'email', 
            'change'
        ],
        data    : {'items' : [
            { 'name' : 'Lisa',  'email' : 'lisa@simpsons.com',  'change' : 100  },
            { 'name' : 'Bart',  'email' : 'bart@simpsons.com',  'change' : -20  },
            { 'name' : 'Homer', 'email' : 'home@simpsons.com',  'change' : 23   },
            { 'name' : 'Marge', 'email' : 'marge@simpsons.com', 'change' : -11  }
        ]},
        sorters : { property:'name', direction:'ASC' }, // default sort
        proxy   : {
            type   : 'memory',
            reader : {
                type : 'json',
                root : 'items'
            }
        }
    });
    
    Ext.create('Ext.grid.Panel', {
        title      : 'Simpsons',
        store      : Ext.data.StoreManager.lookup('simpsonsStore'),
        columns    : [
            { header : 'Name', dataIndex : 'name', sortable: true },
            { header : 'Email', dataIndex : 'email', flex : 1, sortable: true },
            { header : 'Change', dataIndex : 'change', sortable: false } // disable for grins
        ],
        height     : 200,
        width      : 400,
        renderTo   : Ext.getBody()
    });
    Scott.

  4. #3
    Sencha Premium Member
    Join Date
    Oct 2012
    Posts
    6
    Answers
    2
    Vote Rating
    0
    remiszej is on a distinguished road

      0  

    Default grid column sort option greyed out

    grid column sort option greyed out


    Scott, thank you for your reply.

    Your code is pretty much what I have, and the code that I attached always worked for me. The only twist now is
    that in the controller I add filter to this grid's store. However, on startup filter is not applied and sort options in the column header are still grayed out (disabled).

  5. #4
    Sencha Premium Member
    Join Date
    Oct 2012
    Posts
    6
    Answers
    2
    Vote Rating
    0
    remiszej is on a distinguished road

      0  

    Default column sort option greyed out

    column sort option greyed out


    After some troubleshooting I found out that my problem was buffered configuration for the store.
    Once I removed that, column sorting is back.

  6. #5
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    9,085
    Answers
    675
    Vote Rating
    467
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Thanks for the update.

    Scott.

Thread Participants: 1