Ext js Editor Grid Disable Multiple Row Selection

2019-08-23 13:34发布

my grid allowing to select multiple row selection that is once i click on cell and press shift+arrow down button it allows me to select next set of records i wanted to disable this functionality how it can be done,on grid level how to catch keypress events and return false once shift+arrow down button is pressed

标签: Extjs
4条回答
Luminary・发光体
2楼-- · 2019-08-23 13:55

Grids behave as you want by default. Make sure you have NOT set multiSelect or simpleSelect to true.

查看更多
Explosion°爆炸
3楼-- · 2019-08-23 13:57

For ExtJS 3.x add this to the grid properties:

selModel: new Ext.grid.rowSelectionModel({singleSelect:true})

查看更多
成全新的幸福
4楼-- · 2019-08-23 13:58

The accepted answer seems to be a bit out of date. For version ExtJS4.x use this solution :

selModel: new Ext.selection.Model({mode: 'SINGLE'})

Or just use this :

selModel: {mode: 'SINGLE'}
查看更多
Fickle 薄情
5楼-- · 2019-08-23 14:02

Firstly, it's hard to understand your question without any punctuation. Secondly, without any code example, it's even harder to understand a question without any punctuations.

Here's my guess answer of your question:

editorgridpanel.on('keypress', function (e) {
    if (e.shiftKey === true && e.getKey() === e.DOWN) {
        e.stopEvent(); //this will stop the shift+down keypress event from proceeding.
    }
});
查看更多
登录 后发表回答