0
私はフォーム内にフォームを持っています。私は外側のフォームのフィールドの隠されたプロパティを内側のフォームのフィールドのチェックされた状態にバインドする必要があります。ExtJSカスタムバインド
私はフォーム内にフォームを持っています。私は外側のフォームのフィールドの隠されたプロパティを内側のフォームのフィールドのチェックされた状態にバインドする必要があります。ExtJSカスタムバインド
あなたはこのような何かを行うことができます:
Ext.define('Test.InnerForm', {
extend: 'Ext.form.Panel',
xtype: 'innerform',
defaultListenerScope: true,
config: {
isFoo: false
},
twoWayBindable: {
isFoo: true
},
publishes: ['isFoo'],
items:[{
xtype: 'checkbox',
fieldLabel:'cb',
listeners: {
change: 'onCheckChange'
}
}],
onCheckChange: function(box, checked) {
this.setIsFoo(checked);
}
});
Ext.define('Test.OuterForm', {
extend: 'Ext.form.Panel',
xtype: 'outerform',
viewModel: true,
items:[{
xtype:'innerform',
reference: 'innerform'
},{
xtype: 'textfield',
fieldLabel: 'want to hide this when cb is checked',
bind: {
hidden: '{innerform.isFoo}'
}
}]
});
Ext.create('Test.OuterForm', {
title: 'Outer form',
width: 500,
height: 500,
bodyPadding: 10,
renderTo: Ext.getBody()
});
私はカスタムゲッター/セッターはなく、正確にわからないを設定することにより、結合してこれを行うことができ想定し...ここでの考え方です