Results 1 to 3 of 3

Thread: Disable spacebar toggle in Grid

  1. #1
    Sencha Premium Member
    Join Date
    Jan 2013
    Posts
    40
    Answers
    2
    Vote Rating
    5
      0  

    Default Answered: Disable spacebar toggle in Grid

    When you select a row and press spacebar it toggles the selection. Not sure why...

    How can I go about disabling this functionality without turning off enableKeyNav.

    I assume I need to override the onKeyPress event for Ext.selection.RowModel, but how do I do this? I've tried various ways and none seem to work.

    Code:
    //This didn't work....
    Ext.override('Ext.selection.RowModel', {
        onKeyPress: function(e, t) {
          console.log(e);
        }
    });
    //This also didn't work...
    Ext.define('MyApp.selection.RowModel', {
      override: 'Ext.selection.RowModel',
      onKeyPress: function(e, t) {
        console.log(e);
      }
    });

  2. So it seems onKeyPress doesn't exist in 4.2.2 which is what I was using.Ended up going with...

    Code:
    Ext.define('MyApp.selection.RowModel', {
      override: 'Ext.selection.RowModel',
      onKeySpace: function(e) {
        console.log(e);
      }
    });
    Source: http://docs.sencha.com/extjs/4.2.2/source/RowModel.html

  3. #2
    Sencha Premium Member
    Join Date
    Jan 2013
    Posts
    40
    Answers
    2
    Vote Rating
    5
      0  

    Default

    Still looking for an answer to this one if anyone knows.

  4. #3
    Sencha Premium Member
    Join Date
    Jan 2013
    Posts
    40
    Answers
    2
    Vote Rating
    5
      1  

    Default

    So it seems onKeyPress doesn't exist in 4.2.2 which is what I was using.Ended up going with...

    Code:
    Ext.define('MyApp.selection.RowModel', {
      override: 'Ext.selection.RowModel',
      onKeySpace: function(e) {
        console.log(e);
      }
    });
    Source: http://docs.sencha.com/extjs/4.2.2/source/RowModel.html

Posting Permissions

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