1
我在ExtJS的创建切换按钮:如何获取ExtJS中按钮的“按下”属性的状态?
{
xtype: 'button',
text: 'Edit Mode',
id: 'editID',
action: 'myToggle',
pressed: false,
enableToggle: true,
margin: 5,
handler: function (btn, e) {
editMode(btn); // checks the status of the toggle button
}
}
在我的剧本有些部分我想如果选择与否按钮,检查。 我已经尝试了多种方法,如:
var isChecked = Ext.get('editID').pressed; # gives undefined
或者
var parent_sub_id_isChecked = Ext.get('editID').dom.pressed; # also undefined
我怎样才能在ExtJS的一个按钮的“按下”属性的状态?
你可以在你的处理程序中使用var isChecked = btn.pressed来检查。 – Sreek521