PDA

View Full Version : Don't allow checkbox selection with right click



japena03
4 Nov 2013, 3:53 PM
I have a checkbox in a grid and I don't want to allow the checkbox to be checked or unchecked with a right click, only left click. Mainly because I have a context menu on right click and i don't want the checkbox to become selected or unselected when they view the context menu. Any suggestions? I'm not sure where to start looking at this.

G.L.
5 Mar 2014, 12:22 AM
Use the checkboxmodel (Ext.selection.CheckboxModel) option ignoreRightMouseSelection: true.

For example:

Ext.create (http://docs.sencha.com/extjs/4.2.2/#!/api/Ext-method-create)('Ext.grid.Panel (http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.grid.Panel)', { title: 'My grid', selModel: { ignoreRightMouseSelection: true }, columns: [ { text: 'Data 1' } ]});