我正在尝试动态更改面板中 BUTTON 上的文本:
我给出的初始文本是:var gost = "HPCL Jan 20 Put,40 cents ..";
var bottomdetail = new Ext.Panel({
flex:1,
padding: 1,
layout : {
type: 'vbox',
pack: 'center',
align: 'stretch'
},
stretchX: true,
items:[{
xtype: 'button',
flex: 1,
baseCls: 'round',
html: '<table border="0" height="100%" width="100%"><tr><td width="100%" style="color:#fff; padding-left:5px;" valign="middle">'+ gost + '</td><td valign="middle" align="right" style="padding-right:5px;"><img src="resources/Images/rightarrow.png"></img></td></tr></table>',
handler: function(){window.location='DetailsPanel.html';}
}]
});
这是我用它来更改文本的点:
var shakepanel = new Ext.Panel({
layout : {
type: 'hbox',
pack: 'center',
align: 'stretch'
},
stretchX: true,
flex:1,
disable: true,
items: [{
xtype: 'button',
disable: true,
layout: 'fit',
ui: 'decline',
text: 'SHAKE',
flex:1,
handler: function(){
gost="ola i changed it";
alert(bottomdetail.getText());
}
}]
});
当我单击“SHAKE”按钮时,“gost”的值会更新,但如何将更新后的 gost 文本应用到其中包含按钮的底部细节面板......