Huasheng06
2 Jan 2012, 3:40 AM
hello everyone,
I want to customer a tooltip for every cell for the grid, I have to get the rowIndex and colIndex of the mouse cursor. In the following code i can get the colIndex. but how can I get the rowIndex? thanks.
grid.getView().on('render', function(tempview) {
tempview.tip = Ext.create('Ext.tip.ToolTip', {
target : tempview.el,
width : 100,
height : 100,
delegate : tempview.cellSelector,
trackMouse : true,
renderTo : Ext.getBody(),
listeners : {
beforeshow : function updateTipBody(tip, rowIndex) {
var gridColums = tempview.getGridColumns();
var column = gridColums[tip.triggerElement.cellIndex]; //'tip.triggerElement.cellIndex' is the colIndex
var val = tempview
.getRecord(tip.triggerElement.parentNode)
.get(column.dataIndex);
tip.update(val);
}
}
});
});
I want to customer a tooltip for every cell for the grid, I have to get the rowIndex and colIndex of the mouse cursor. In the following code i can get the colIndex. but how can I get the rowIndex? thanks.
grid.getView().on('render', function(tempview) {
tempview.tip = Ext.create('Ext.tip.ToolTip', {
target : tempview.el,
width : 100,
height : 100,
delegate : tempview.cellSelector,
trackMouse : true,
renderTo : Ext.getBody(),
listeners : {
beforeshow : function updateTipBody(tip, rowIndex) {
var gridColums = tempview.getGridColumns();
var column = gridColums[tip.triggerElement.cellIndex]; //'tip.triggerElement.cellIndex' is the colIndex
var val = tempview
.getRecord(tip.triggerElement.parentNode)
.get(column.dataIndex);
tip.update(val);
}
}
});
});