问题
In ExtJS 6.2.0. I have a standard grid. The grid's selection model, and all of it's related functions like the highlighting of grid rows, is by default triggered by the single click event.
I would like to keep all of the selection model's functionality, but driven by a double click event instead.
I was thinking along the line of killing the default single click event listener, and introducing a dedicated double click event listener. But I can't find any handle on this default event listener.
Any suggestions?
回答1:
Use clicksToEdit property in grid plugins as follow
Ext.define('Test.MyGrid', {
extend:'Ext.grid.Panel',
store: store,
xtype:'myGrid',
plugins: {
rowediting: {
clicksToEdit: 2,
autoCancel: false
}
},
columns: [
{ text: 'Name', dataIndex: 'name',editor:{
allowBlank: false
} },
{ text: 'Email', dataIndex: 'email', flex: 1 },
{ text: 'Phone', dataIndex: 'phone' }
]
});
Check working example https://fiddle.sencha.com/#view/editor&fiddle/2ma9
来源:https://stackoverflow.com/questions/61557779/how-to-replace-the-default-click-event-by-a-double-click-event-for-grid-row-sele