1. #1
    Sencha User
    Join Date
    Sep 2009
    Posts
    9
    Vote Rating
    0
    mtobar is on a distinguished road

      0  

    Default Problem with CheckboxSelectionModel and listener on store.

    Problem with CheckboxSelectionModel and listener on store.


    Hi, I have checked trouble to write the rows of a grid that has a selModel = CheckboxSelectionModel. I attached my code. The strange thing is that I work loading the event but the rows are not checked. I appreciate any help.

    Code:
        var checkBox = new Ext.grid.CheckboxSelectionModel();
        
        checkBox.on('rowselect', function(a,rowIndex,record){
                var layer = map.getLayersByName("mob_"+record.get('id').toString());
                layer[0].setVisibility(true);
          },this);
    
        var grid = new Ext.grid.GridPanel({
            title   :   'Lista de Móviles',
            store   :   store,
            border  :   false,
            autoScroll  :   true,
            stripeRows  :   true,
            loadMask    :   false,
            stateful    :   true,
            id      :   'gridMovil',
            name    :   'gridMovil',
            region  :   'center',
            selModel    :   checkBox,
            columns     :   colModel.columns
        });
         Ext.getCmp('gridMovil').getStore().on('load', function(store, opt){
                 Ext.getCmp('gridMovil').getSelectionModel().selectAll();
         });  
        
          Ext.getCmp('gridMovil').getStore().loadData(respuesta.movil);

  2. #2
    Sencha - Community Support Team sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,333
    Vote Rating
    85
    sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough sword-it is a jewel in the rough

      0  

    Default debug firing events

    debug firing events


    Hi mtobar

    Did you check whether 'load' and 'rowselect' events are firing or not? Also If you provide store and colmodel I can understand your problem well.Below code is basic example that works fine

    Code:
    var selModel = new Ext.grid.CheckboxSelectionModel({
    listeners: {
    rowselect: function () {
    alert('rowselect')
    }
    }
    })
    var grid = new Ext.grid.GridPanel({
    renderTo: Ext.getBody()
    , store: {
    xtype: 'jsonstore'
    , root: 'item'
    , fields: ['x']
    }
    , colModel: new Ext.grid.ColumnModel({
    columns: [
    selModel,
    { header: 'a', dataIndex: 'x' }
    ]
    })
    , selModel: selModel
    })
    grid.getStore().on('load', function () { grid.getSelectionModel().selectAll(); })
    grid.getStore().loadData({ item: [{ x: 'asd'}] });
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

Thread Participants: 1

Tags for this Thread

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..."