1
如何更改位於選項卡面板中的面板的工具提示?最初,當面板被添加到tabpanel時,我使用面板構造函數的tabtip參數創建了一個工具提示。ExtJS(3.4):更新TabPanel中面板的工具提示
如何更改位於選項卡面板中的面板的工具提示?最初,當面板被添加到tabpanel時,我使用面板構造函數的tabtip參數創建了一個工具提示。ExtJS(3.4):更新TabPanel中面板的工具提示
您需要抓取表示選項卡標籤條的DOM元素。您可以使用tabPanel.getTabEl(tabID)來獲取條形元素。然後,您可以抓取.x-tab-strip-text
範圍並設置其qtip
屬性。
// be sure to set your tab's itemId
var tabPanel = new Ext.TabPanel({
items: [{
title: 'one tab',
tabTip: 'something',
itemId: 'firstTabID',
html: 'haha wooo'
}]
});
// later...
// .getTabEl grabs the tabstrip DOM element
// Ext.get converts it to an Ext.Element
Ext.get(tabPanel.getTabEl('firstTabID'))
// find its descendent span that contains the tab's title text
.child('span.x-tab-strip-text', true)
// and set the tool tip
.qtip = 'something completely different!';
之前,所以我周圍挖the Ext.TabPanel source看他們是如何設置它,我從來沒有改變標籤提示。我也學到了東西:)
真棒迴應(+1);謝謝! – Upperstage 2012-08-17 18:08:47