1

パネルに配置されたツールからツールチップテキストを変更する方法はありますか?ToolTipオブジェクトとQuickTipを見ましたが、どちらにもsetTipText()のような関数はありません。

ありがとう、Y_Y

4

2 に答える 2

5

ツールチップにitemIdを配置できなかったため、次のようにツールのツールチップを動的に更新できました。

var toolTip = Ext.get(tool.getEl().id + '-toolEl');
toolTip.set({ 
    'data-qtitle': 'New Tooltip Title', //this line is optional
    'data-qtip': 'Updated Tool Tip!' 
});
于 2014-07-11T01:16:57.780 に答える
3

私はあなたの問題に対して2つの解決策を持っています!

  1. HTML属性を変更する

    toolTip=Ext.ComponentQuery.query('tooltip[itemId=myToolTip]')[0];
    toolTip.html = "This is the new text!";
    toolTip.setTitle("new Title");
    toolTip.render();
    
  2. 古いものを破壊し、新しいものを作ります...

    tooltip.destroy();
    var config = {
        target: 'bottomCallout',
        anchor: 'top',
        anchorOffset: 85, // center the anchor on the tooltip
        html: "Fancy new ToolTip with a totally different config..."
    };
    Ext.create('Ext.tip.ToolTip', config);
    
于 2013-01-12T10:12:04.650 に答える