1
我想提交从菜单按钮的值,但知道这是不可能的,我必须创建一个隐藏的字段,并在那里存储按钮值。ExtJs提交menubutton值
作为ExtJs的新手,我似乎无法弄清楚如何做到这一点。以下是我用来检查按钮显示的基本布局,我可以选择一种颜色。
getFormItems : function() {
var me = this;
return [{
xtype : "fieldset",
title : "Items to monitor",
defaults : {
labelSeparator : ""
},
items : [{
xtype : "checkbox",
name : "cpuenable",
boxLabel : _("Will monitor CPU Temperature"),
fieldLabel : _("CPU Temperature"),
checked : false
},{
xtype : 'hiddenfield',
id : 'buttonvalues'
},{
xtype : "button",
name : "colours",
text : _("Choose Colours"),
scope : this,
style : {
marginTop : "10px",
marginBottom : "10px"
},
menu: [{
text: "Main CPU Colour",
menu: {
xtype : "colormenu",
name : "colourc",
value : "000000",
cls : "menubutton-class",
handler: function (obj, rgb) {
var colourmField = this.findField('colourc');
colourmField.setValue(rgb.toString());
alert(colourmField.getValue());
}
}
},{ and so on
感谢您的回答,我更新了代码以chec k如果目前为止是正确的。 – jhmiller 2014-09-28 12:21:52
每次我尝试使用Ext.Array时,它都会停止工作的代码。现在是否有机会检查代码是否存在错误。 – jhmiller 2014-09-28 12:50:34
我现在完全失去了,尝试了所有我能想到的使用上述建议,但无法快速完成。 Tyr或其他人可以提供更多关于如何实现目标的细节。 – jhmiller 2014-09-28 18:43:44