PDA

View Full Version : Locking grid - Event not binding for locked and normal grid



SurenderBhyan1
30 May 2017, 4:51 AM
Hi,

I am having a grid where first two column is locked: true.

I am trying to extend cell model for cell mouse over event, but it's not working.

When I mouse over a cell, its not getting fired.

Please suggest me here how I can bind both locked and normal view so each event I bind got executed fine.



Ext.define('Ext.ux.grid.egrid.AdjustmentMultiCellSelectionModel', {
extend: 'Ext.selection.CellModel',
alias: 'widget.MultiCellModel',
bindComponent: function(view) {
var me = this,
grid = view.ownerCt;
me.primaryView = view;
me.views = me.views || [];
me.views.push(view);
me.bindStore(view.getStore(), true);


view.on({
cellmousedown: me.onMouseDown,
cellcontextmenu: me.onContextmenu,
cellmouseup: me.onMouseUp,
cellmouseover: me.onMouseOver,
refresh: me.onViewRefresh,
scope: me
});
if (grid.optimizedColumnMove !== false) {
grid.on('columnmove', me.onColumnMove, me);
}
if (me.enableKeyNav) {
me.initKeyNav(view);
}
})

SurenderBhyan1
31 May 2017, 3:58 AM
@Gary, can you suggest some workaround for this.

Gary Schlosberg
31 May 2017, 10:37 AM
So it's working on the normal side of the grid?

SurenderBhyan1
1 Jun 2017, 4:11 AM
So it's working on the normal side of the grid?

Gary,

I am providing a fiddle for ease.

Only cellmouseover is not working in either grid. If i remove locking , then it works



view.on({
cellmousedown: me.onMouseDown, // Working

cellmouseup: me.onMouseUp, //Working

cellmouseover: me.onMouseOver, // Not working

cellkeydown: me.onKeyD, //working

cellcontextmenu: me.onContextmenu, // Working

refresh: me.onViewRefresh,

scope: me
});


view.headerCt.addListener('headerclick', me.onHeaderClick); // Working




Please have a try in below fiddle. You can see the output in browser console.

https://fiddle.sencha.com/#view/editor&fiddle/20nf

Need your assistance here :)

Gary Schlosberg
6 Jun 2017, 3:39 PM
I don't see a cellmouseover event available on the grid panel.
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.grid.Panel

SurenderBhyan1
6 Jun 2017, 8:53 PM
I don't see a cellmouseover event available on the grid panel.
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.grid.Panel

Thanks Gary for assisting me,

I am using MultiCellSelectionModel.js where I am binding these event on view in bindComponent method.

My confusion is here that If I add locked: true for any columns then cellmouseover on cells is not firing in any grid (locked as well as normal one), but if I remove locked: true from same columns then cellmouseover event is firing well.

See below fiddle where I have removed locking and cellmouseover is firing perfectly.

https://fiddle.sencha.com/#view/editor&fiddle/20ve