anzeigen und ausblenden von Element
Mein problem dieses mal ist, machen ein Element erscheinen und verschwinden.
Ich weiß, es ist getan mit hide()
und show()
aber ich weiß nicht wie?
Hier ist mein code. Ich möchte ein xtype erscheinen : "datepickerfield" wenn ich die Option "Termin" in "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);
danke. ich habe versucht, wie du sagst :
{
xtype: "datepickerfield",
id: "startDate",
label: "when",
picker: { yearFrom: 2012, yearTo: 2020}
this.items.getAt().hide();
},
aber es funktioniert nicht.
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},
},
ich versuchte dieses aber es funktioniert nicht
InformationsquelleAutor zied jouini | 2012-03-14
Du musst angemeldet sein, um einen Kommentar abzugeben.
Können Sie eine der zwei Methoden:
hide()/show()
odersetVisible(true/false)
.Wenn Sie möchten, Zugriff auf Ihre Gegenstände im inneren des Objekts (zum Beispiel, innerhalb initComponent () - Ereignis), die folgende Klausel verwenden:
Werden, um Zugriff auf das element aus der Klasse, Sie tut es, indem getCmp () - Methode:
und dann auf das Element, und legen Sie die Sichtbarkeit.
InformationsquelleAutor sna19