我试图改变动态按钮是在面板中的文字:如何动态更改我的布局文本?
我给的初始文本是: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';}
}]
});
这里是我用它来PIONT更改文本:
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文本到具有在它的按钮bottomdetail面板... ..........
兄弟你可以更具体我尝试使用,但它不是什么都没有做............ – 2011-01-19 11:43:19
你是否也添加一个id到包含文本的单元格? – adamdunne 2011-01-19 14:04:52