今回の課題は、アイテムを出現させたり消滅させたりすることです。私はそれが行われていることを知っていますがhide()、show()方法がわかりませんか? これが私のコードです。「selectfield」で「Appointment」を選択すると、「datepickerfield」というxtypeを表示させたい
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);
ありがとうございました。私はあなたが言うように試しました:
{
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},
},
私はこれを試しましたが、うまくいきません