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

Schreibe einen Kommentar