1..使用renderer;
{
header: "公司",
name: 'company',
width: 200,
renderer:function(value,cell,record){
var qtipTpl = new Ext.XTemplate("<p><b>Company:</b> {company}<br>{price}<br />{size}</p>"); var qtip = qtipTpl.apply(record.data); return '<div qtip="' + qtip +'">' + value + '</div>' }
},
2. grid.on('render', function() { grid.tip = new Ext.ToolTip({ view: grid.getView(), target: grid.getView().mainBody, delegate: '.x-grid3-row', trackMouse: true, renderTo: document.body, listeners: { beforeshow: function updateTipBody(tip) { console.log(grid.store.getAt(tip.triggerElement.rowIndex).data); tip.body.dom.innerHTML = "Over row " + tip.view.findRowIndex(tip.triggerElement); } } }); }); |