1. #1
    Ext User
    Join Date
    Jun 2008
    Posts
    20
    Vote Rating
    0
    hazek is on a distinguished road

      0  

    Talking How to use Ext.query for components?

    How to use Ext.query for components?


    Hello.

    How can i get all ID of my TextFields components using an Ext.query() Method.
    For example:

    var objs = Ext.query("TextField");
    for(var i = 0; i < objs.length; i++) {
    Ext.getCmp(objs[i].id).on(
    'change',
    myFunctionX
    );


    But i can't get the components ID
    Thanks!

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,823
    Vote Rating
    608
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Ext.query only works for the DOM. Why can't you just keep a collection of text fields yourself?

  3. #3
    Ext User
    Join Date
    Jun 2008
    Posts
    20
    Vote Rating
    0
    hazek is on a distinguished road

      0  

    Default


    Quote Originally Posted by evant View Post
    Ext.query only works for the DOM. Why can't you just keep a collection of text fields yourself?
    Are you talking about that me use an array for store the ID and after use it for loop in?

    Hmm but if a have a lot of elements?
    Doesn't exist a way to do this automatically?

  4. #4
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,823
    Vote Rating
    608
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Why would it be any less efficient for you to store a collection if there's lots?

  5. #5
    Ext User
    Join Date
    Jun 2008
    Posts
    20
    Vote Rating
    0
    hazek is on a distinguished road

      0  

    Wink


    Quote Originally Posted by evant View Post
    Why would it be any less efficient for you to store a collection if there's lots?
    hmmmmmm
    When you told me "just keep a collection" what do you mean?
    Hehehe the problem is that i don't understand well the english language and the worst is that i'm a noob with ExtJS and i'm some confused.


    Will be so annoying if you can put a small example?
    Thanks again!

  6. #6
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,823
    Vote Rating
    608
    evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute evant has a reputation beyond repute

      0  

    Default


    Code:
    var items = [];
    items.push(myFirstTextField, mySecondTextField);
    
    Ext.each(items, function(item)
    {
       alert(item.id);
    }
    );

  7. #7
    Ext User
    Join Date
    Jun 2008
    Posts
    20
    Vote Rating
    0
    hazek is on a distinguished road

      0  

    Default


    You are so amiable.

    Thanks!

Thread Participants: 1

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