0
votes

In ExtJS 4, selecting a row in a Grid Panel (by clicking it), and pressing the spacebar selects and de-selects the row. It was not like this in ExtJS 3, and I would like to disable this feature.

Any ideas? I've begin looking into Ext.util.KeyMap to see if I could override it somehow. Thanks in advance.

1

1 Answers

3
votes

You have to override the onKeyPress method of the Ext.selection.RowModel. The shipped implementation is

onKeyPress: function(e, t) {
    if (e.getKey() === e.SPACE) {
        e.stopEvent();
        var me = this,
            record = me.lastFocused;

        if (record) {
            if (me.isSelected(record)) {
                me.doDeselect(record, false);
            } else {
                me.doSelect(record, true);
            }
        }
    }
}

Unfortunately there currently is no configuration switch to turn off that behavior.