Hybrid View

  1. #1
    Sencha User Baron89's Avatar
    Join Date
    Aug 2012
    Posts
    58
    Vote Rating
    0
    Baron89 is on a distinguished road

      0  

    Default grid panel sort listener

    grid panel sort listener


    Hi all,
    is there a listener that listen to grid panel column sorting?
    i tried to use sortchange() like below, but seems not working?
    Code:
    var cm = new Ext.grid.ColumnModel([
     {
       header: '',
      width: 100,
      dataIndex: 'op',
      sortable: true, 
       hidden:true,
       listener:{
           sortchange : function(){alert("");}
       }
     }
    ])

  2. #2
    Sencha User
    Join Date
    Jan 2011
    Posts
    541
    Vote Rating
    50
    willigogs is a jewel in the rough willigogs is a jewel in the rough willigogs is a jewel in the rough

      1  

    Default


    You need to add the sortChange listener to the grid, not the column
    http://docs.sencha.com/ext-js/3-4/#!...ent-sortchange

  3. #3
    Sencha User Baron89's Avatar
    Join Date
    Aug 2012
    Posts
    58
    Vote Rating
    0
    Baron89 is on a distinguished road

      0  

    Default


    Quote Originally Posted by willigogs View Post
    You need to add the sortChange listener to the grid, not the column
    http://docs.sencha.com/ext-js/3-4/#!...ent-sortchange
    may i know how?

  4. #4
    Sencha User
    Join Date
    Jan 2011
    Posts
    541
    Vote Rating
    50
    willigogs is a jewel in the rough willigogs is a jewel in the rough willigogs is a jewel in the rough

      1  

    Default


    Code:
    var grid = new Ext.grid.GridPanel({
        // GRID CONFIG OPTIONS
        listeners: {
            sortchange: function(thisGrid, sortinfo) {
                console.log(thisGrid, sortinfo)
                alert('Sort has been clicked!')    
            }
        }
    });

  5. #5
    Sencha User Baron89's Avatar
    Join Date
    Aug 2012
    Posts
    58
    Vote Rating
    0
    Baron89 is on a distinguished road

      0  

    Default


    Quote Originally Posted by willigogs View Post
    Code:
    var grid = new Ext.grid.GridPanel({
        // GRID CONFIG OPTIONS
        listeners: {
            sortchange: function(thisGrid, sortinfo) {
                console.log(thisGrid, sortinfo)
                alert('Sort has been clicked!')    
            }
        }
    });
    that listener get fired when the page just loaded. and not being called when we click 'sort'

  6. #6
    Sencha User
    Join Date
    Jan 2011
    Posts
    541
    Vote Rating
    50
    willigogs is a jewel in the rough willigogs is a jewel in the rough willigogs is a jewel in the rough

      1  

    Default


    Can you share how you have implemented the code?

    Here's a working example with the exact same code as posted above:
    http://jsfiddle.net/Whinters/C5ctN/

Thread Participants: 1

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar