日期:2014-05-16  浏览次数:20397 次

给ExtJs树节点添加提示
1 给树treeview增加事件监听
"#filetreeview": {
	itemmouseenter: this.onFiletreeviewItemMouseEnter
}

2 实现监听函数

onFiletreeviewItemMouseEnter: function(dataview, record, item, index, e, eOpts) {
	dataview.tip = Ext.create('Ext.tip.ToolTip', {
		target: item,
		delegate: dataview.itemSelector,
		trackMouse: true,
		renderTo: Ext.getBody(),
		listeners: {
			beforeshow: function updateTipBody(tip) {
				tip.update(record.get('name'));
			}
		}
	});
	return false;
}