1. #1
    Sencha User
    Join Date
    Feb 2009
    Posts
    53
    Vote Rating
    0
    MacSimon is on a distinguished road

      0  

    Default

    Hi everyone,

    I would like to know how to catch the event
    for selecting/deselecting everything.

    I need this because I am using the checkboxselectionmodel in combination with paging
    and therefor need to implement my own logic.

    example of my code:

    [CODE]
    var checkboxSelectionModel = new Ext.grid.CheckboxSelectionModel({
    checkOnly:
    true
    });


    var myView = new Ext.grid.GridView({
    id:
    [SIZE=2][COLOR=#a31515][SIZE=2][COLOR=#a31515]

  2. #2
    Ext JS Premium Member
    Join Date
    Aug 2009
    Posts
    6
    Vote Rating
    0
    sabilfikri is on a distinguished road

      0  

    Default

    hi,
    I'm trying to do the exact same thing. I tried using listeneres to catch the 'check' event, but it doesn't seem to work. any help on this?

    this is a piece of my code:
    Code:
    var ChkSelModel = new Ext.grid.CheckboxSelectionModel({
            header: '<div class="x-grid3-hd-checker"> </div>',
            singleSelect: false,
            listeners: {
                'check' : function(r, c) {
                    if (c) {
                        Ext.getCmp(action_id).setDisabled(false);
                    } else {
                        Ext.getCmp(action_id).setDisabled(true);
                    }
                }
            }
        });

  3. #3
    Sencha User
    Join Date
    Mar 2008
    Posts
    566
    Vote Rating
    0
    moegal is on a distinguished road

      0  

    Default

    did you ever figure this out? Seems this would be handy.

    Marty

  4. #4
    Sencha User
    Join Date
    May 2011
    Posts
    1
    Vote Rating
    0
    parchana is on a distinguished road

      0  

    Default

    I don't see any answers to this for a while. Trying to fire the "check" event but it doesn't work. I'm using EXT JS 3.3.1

    Any ideas, please?

  5. #5
    Sencha User
    Join Date
    Sep 2009
    Location
    London
    Posts
    54
    Vote Rating
    1
    harel is on a distinguished road

      0  

    Default Workaround

    For the sake of posterity and history, I'm adding the solution I used here.

    I added the following listener to the selection model:

    Code:
    listeners: {
            		selectionchange: function(sm) { 
            			var allSelected = sm.selections.length >= sm.grid.getStore().getTotalCount();
            			// now handle based on allSelected or the actual selection....
            		}
            	}