PDA

View Full Version : How to detect a mouse click of outer grid



sdd0
10 Mar 2015, 11:04 PM
I want to detect a mouse click when it is on the outer grid so that I can deselect all rows (by grid.getSelectionModel().deselectAll()).

In the beginning, I used grid's 'blur' event, when the focus was not on the grid I could deselect all rows, but it did not work. I saw a post about this below, it says 'blur' is not fired actually in the grid.
http://www.sencha.com/forum/showthread.php?292568
(http://www.sencha.com/forum/showthread.php?292568)
Could anyone please tell me a solution?

Below is my grid code:



Ext.define('myapp.common.myComponent.myGridPanel', {
extend: 'Ext.grid.GridPanel',
allowDeselect:true,
initComponent: function() {
var me = this;
Ext.apply(this, {
stripeRows: true,
stateful: true,
stripeRows: true,
anchor: '-50',
autoHeight: true,
enableDragDrop: true,
style: 'margin-left:25;',
multiSelect: true
});
this.callParent();
}
});

Gary Schlosberg
6 Apr 2015, 7:36 AM
I believe the only way to do it is with a bit of work, as described in this thread:
http://www.sencha.com/forum/showthread.php?267489