2
이번에는 아이템을 표시하거나 사라지게하는 것이 좋습니다. 나는 그것이 hide()
과 show()
으로 끝난다는 것을 알고있다. 그러나 나는 어떻게 몰라? 내 코드는 다음과 같습니다. 나는 "selectfield"의 "약속"을 선택하면 아이템 숨기기 및보기
App.views.Bankingrendezvous = Ext.extend(Ext.Panel, {
items: [{
xtype: 'formpanel',
id: 'form',
fullscreen: true,
scroll: 'vertical',
items: [{
xtype: 'fieldset',
title: 'Information & Appointment',
},
{
xtype: 'selectfield',
id: 'request',
label: 'You need',
options: [
{
text: 'Appointment',
value: 'Appointment'
},
{
text: 'Information',
value: 'Information',
}]
},
{
xtype: "datepickerfield",
id: "startDate",
label: "when",
picker: { yearFrom: 2012, yearTo: 2020}
},}]
}]
});
Ext.reg('Bankingrendezvous', App.views.Bankingrendezvous);
당신을 감사합니다 "datepickerfield를"나는 위해 xtype 표시 만들고 싶어. 나는 당신이 말하는대로 시도했다 :
{
xtype: "datepickerfield",
id: "startDate",
label: "when",
picker: { yearFrom: 2012, yearTo: 2020}
this.items.getAt().hide();
},
그러나 그것은 작동하지 않는다.
items: [{
xtype: 'formpanel',
id: 'form',
fullscreen: true,
scroll: 'vertical',
items: [{
xtype: 'fieldset',
title: 'Information & Appointment',
},
{
xtype: 'selectfield',
id: 'request',
label: 'You need',
options: [
{
text: 'Appointment',
value: 'Appointment'
},
{
text: 'Information',
value: 'Information',
}],
listeners: {
function()
{
if (Ext.getCmp('request').getValue() == 'Information')
{
Ext.getCmp('startDate').hide();
}
}
},
},
{
xtype: "datepickerfield",
id: 'startDate',
label: "when",
picker: { yearFrom: 2012, yearTo: 2020},
},
내가이 시도하지만