1. #1
    Sencha User
    Join Date
    May 2012
    Location
    Ukraine
    Posts
    23
    Answers
    2
    Vote Rating
    0
    ralfius is on a distinguished road

      0  

    Default Answered: CheckboxModel deselection difference

    Answered: CheckboxModel deselection difference


    Hello,
    I have a grid with Ext.selection.CheckboxModel.
    Code:
    Ext.define('MyGrid',
    {
        extend: 'Ext.grid.Panel',
        store: Ext.create('MyStore'),
        columns: [{
            header: 'Code',
            dataIndex: 'Code'
        },{
            header: 'Name',
            dataIndex: 'Name'
        }],
        initComponent: function(){
            this.selModel = Ext.create("Ext.selection.CheckboxModel",{
                    checkOnly : true,
                    listeners: {
                        select: function(row, record, index, eOpts){
                            myBusinessService.select(record);
                        },
                        deselect: function(row, record, index, eOpts){
                            myBusinessService.deselect(record);
                        }
                    }
                });
            this.callParent(arguments);
        }
    });
    I have to make some actions when user selects or deselects some record in this grid. In some cases the store for this grid is reloading. In ExtJS 4.1.1 before store is loaded there happens deselection of all selected item that makes deselect event for Checkboxmodel fired. But I just want to process user selection\deselection. How can I distinguish deselection via store reloading and user deselection? Thanks!

  2. I found the solution. In order to prevent deselecting all selected rows in grid with CheckboxModel when store is reloading, before store loading there should be done store.removeAll(). After this you can use store.load(). Deselect event isn't fired.

  3. #2
    Sencha User metalinspired's Avatar
    Join Date
    Apr 2012
    Posts
    98
    Answers
    4
    Vote Rating
    4
    metalinspired is on a distinguished road

      0  

    Default


    I couldn't quite figure out what are you saying but pruneRemoved might be of some help maybe.

  4. #3
    Sencha User
    Join Date
    May 2012
    Location
    Ukraine
    Posts
    23
    Answers
    2
    Vote Rating
    0
    ralfius is on a distinguished road

      0  

    Default store.removeAll()

    store.removeAll()


    I found the solution. In order to prevent deselecting all selected rows in grid with CheckboxModel when store is reloading, before store loading there should be done store.removeAll(). After this you can use store.load(). Deselect event isn't fired.

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..." hd porno faketaxi