How to replace the default click event by a double click event for grid row selection in ExtJS

时间秒杀一切 提交于 2020-05-17 07:04:15

问题


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

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