PDA

View Full Version : How do you get the column number when in itemmouseenter



Patrick Bennett
19 Feb 2014, 1:28 PM
Hi,

I grabbed a plugin that was for a previous version of ExtJS that uses:

this.grid.on("itemmouseover", this.handleMouseOver, this);

and then:


handleMouseOver:function(g, row, cell, e){

The problem is in 4.2.2 there is no "itemmouseover", just "itemmouseenter" and it doesn't provide the cell:

dataview, record, item, index, e, eOpts

How do I get the column number from this data? I need to select a range of cells as the user drags over them with the mouse down.

Thanks,
Patrick

Patrick Bennett
19 Feb 2014, 2:18 PM
Actually answered my own question by digging with some different search terms. Currently I have a controller which calls a function I created on the CellModel via override (going to make it into a class someday instead of overrides), called mouseDrag, when mousedown has happened and itemmouseenter event is fired.



mouseDrag: function(dataview, record, item, index, e, eOpts) {
var me = this;
var cell = e.getTarget(me.view.cellSelector),
header = me.view.getHeaderByCell(cell),
pos = me.view.getPosition(record, header);

// Clear the current selected array and rebuild it from the current start point to this cell
me.deselectAll();
me.selectRange(index, pos.column);
}


Still working on the deselect, select process...
Patrick