Results 1 to 6 of 6

Thread: limited CheckboxModel

  1. #1
    Ext JS Premium Member
    Join Date
    Feb 2012
    Posts
    21

    Default Answered: limited CheckboxModel

    Hallo,
    I've a Grid with CheckboxModel and I would limited the selection of two selections/rows. How can I limited this?

    thanks for help

  2. Code:
    grid.on('beforeselect', function(selModel, rec) {
        return selModel.getCount() < 2;
    }, grid);

  3. #2
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    If you return false in the beforeselect event it will stop the selection.
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  4. #3
    Ext JS Premium Member
    Join Date
    Feb 2012
    Posts
    21

    Default

    thanks, but how I can return false in the beforeselect?

  5. #4
    Sencha Premium User mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    40,379
    Answers
    3997

    Default

    Code:
    grid.on('beforeselect', function(selModel, rec) {
        return selModel.getCount() < 2;
    }, grid);
    Mitchell Simoens @LikelyMitch

    Check out my GitHub:
    https://github.com/mitchellsimoens

    Posts are my own, not any current, past or future employer's.

  6. #5
    Ext JS Premium Member
    Join Date
    Feb 2012
    Posts
    21

    Default

    thanks for your help

  7. #6
    Ext JS Premium Member
    Join Date
    Feb 2012
    Posts
    21

    Default

    An how can I deselected the first selection when trying to select more.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •