我使用此代碼在網格的每一行顯示自定義工具提示。問題是我只能在一些列上顯示它。我如何檢索beforeshow事件中的cellIndex? 我試着tipp.triggerElement.cellIndex和tipp.anchorElement.cellIndex,但我得到了一個未定義extjs工具提示獲取單元格索引
var tip = Ext.create('Ext.tip.ToolTip', {
// The overall target element.
target: grid.el,
// Each grid row causes its own separate show and hide.
delegate: grid.view.cellSelector,
// Moving within the row should not hide the tip.
trackMouse: true,
// Render immediately so that tip.body can be referenced prior to the first show.
renderTo: Ext.getBody(),
listeners: {
// Change content dynamically depending on which element triggered the show.
beforeshow: function updateTipBody(tipp) {
}
}
});
我得到了一個未定義,可你在哪裏找到getCurrentPosition方法請你聯繫我?我無法在[docs]中找到它(http://docs.sencha.com/extjs/4.2.2/#!/api/Ext.selection.Model) – andyts93
http://docs.sencha.com/ ExtJS的/ 4.2.2 /#!/ API/Ext.selection.CellModel法,getCurrentPosition。如果它分機js 5或以上去與getPosition方法 –