2012-02-08 70 views
0

是否有任何方法可以爲Extjs手風琴項目標題添加工具提示。我正在使用手風琴項目樹面板。Extjs4手風琴項目標題顯示工具提示

我的手風琴面板

Ext.create('Ext.Panel', { 
    region: 'west', 
    split: true, 
    width: '20%', 
    collapsible: true, 
    title: 'Accordian', 
    iconCls: 'application-side-tree', 
    layout: 'accordion', 
    items: [ 
     Ext.create('Ext.tree.Panel', { 
     id: 'tree-1', 
     store: Store1, 
     title: 'First item tree', 
     rootVisible: false, 
     layout: 'fit', 
     draggable: false 
    }), 
     Ext.create('Ext.tree.Panel', { 
     id: 'tree-2', 
     store: Store2, 
     title: 'Second item tree', 
     rootVisible: false, 
     layout: 'fit', 
     draggable: false 
    }) 
     ], 
}); 

回答

2

可以使用QuickTips例如:

var panel = Ext.create('Ext.panel.Panel', { 
    renderTo: Ext.getBody(), 
    width: '80%', 
    title: 'Accordian', 
    layout: 'accordion', 
    items: [ 
     Ext.create('Ext.panel.Panel', { 
      title: 'First item tree', 
      tooltip: 'tip 1', 
      html: 'blah blah' 
     }), 
     Ext.create('Ext.panel.Panel', { 
      title: 'Second item tree', 
      tooltip: 'tip 2', 
      html: 'blah blah' 
     }) 
    ], 
    height: 200 
}); 

panel.items.each(function(p) { 
    Ext.create('Ext.tip.ToolTip', { 
     target: p.header.id, 
     html: p.tooltip 
    }); 
}); 

Ext.QuickTips.init(); 

工作樣本:http://jsfiddle.net/r4tt5/

+0

感謝名單洛洛,它幫助 – jeewiya 2012-02-10 04:32:19