1. #1
    Sencha User
    Join Date
    Jul 2012
    Posts
    56
    Vote Rating
    1
    markgogreen is on a distinguished road

      0  

    Default What to use instead of id's????

    What to use instead of id's????


    I am trying to reuse some view, but I have conditions based on if the user is logged in or not. I am doing a hide and show on the different items. Of course, when I use id and the getCmp, I get errors because the id's have already been used.

    I saw a post for itemid, but that doesn't seem to be working. Each item is a unique xtype, something like this:

    items: [
    {
    xtype: 'comment_form_MPF'
    },
    {
    xtype: 'comment_not_logged_in_MPF'
    }

    ],

    Isn't there away to get the xtype??

    Any suggestions would be great.

  2. #2
    Sencha User loiane's Avatar
    Join Date
    Aug 2009
    Posts
    183
    Vote Rating
    52
    loiane is a jewel in the rough loiane is a jewel in the rough loiane is a jewel in the rough

      0  

    Default


    Use Ext.ComponentQuery.query('your_xtype')

    http://docs.sencha.com/ext-js/4-1/#!...ComponentQuery
    Sencha/Java evangelist
    Author of ExtJS 4 First Look and Mastering Ext JS books
    English blog: http://loianegroner.com
    Portuguese blog: http://loiane.com
    Sencha Examples: https://github.com/loiane

  3. #3
    Sencha User
    Join Date
    Jul 2012
    Posts
    56
    Vote Rating
    1
    markgogreen is on a distinguished road

      0  

    Default


    Makes sense. The Ext.ComponentQuery.query doesn't seem to have any methods. How would I hide and show?

    Uncaught TypeError: Object [object Object] has no method 'hide'




  4. #4
    Sencha - Support Team scottmartin's Avatar
    Join Date
    Jul 2010
    Location
    Houston, Tx
    Posts
    8,927
    Vote Rating
    443
    scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future scottmartin has a brilliant future

      0  

    Default


    Query is simply used to gain access to the control. Then you issue the method

    Code:
    var form = Ext.create('Ext.form.Panel', {
        title: 'Contact Info',
        width: 300,
        bodyPadding: 10,
        renderTo: Ext.getBody(),
        items: [{
            xtype: 'textfield',
            name: 'name',
            itemId: 'mytextfield',
            fieldLabel: 'Name'
        }, {
            xtype: 'textfield',
            name: 'email',
            fieldLabel: 'Email Address'
        }]
    });
    
    // same premise as using query
    var tfield = form.down('#mytextfield');
    tfield.hide();
    ​
    Scott.

Thread Participants: 2

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi