Ext js Editor Grid Disable Multiple Row Selection

给你一囗甜甜゛ 提交于 2019-12-25 06:51:12

问题


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


回答1:


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

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




回答2:


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




回答3:


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.
    }
});



回答4:


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'}


来源:https://stackoverflow.com/questions/9289459/ext-js-editor-grid-disable-multiple-row-selection

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!