1. #1
    Ext User sosamv's Avatar
    Join Date
    Apr 2009
    Posts
    81
    Vote Rating
    0
    sosamv is on a distinguished road

      0  

    Default Unanswered: Extjs Core cuestion

    Unanswered: Extjs Core cuestion


    Hi! I need to add the click event for each element of the CompositeElement and toggle its own class.


    Code:
    arr = Ext.select('.cMenuParentCollapsed'); 
    
    arr.each(function(){ 
          this.on("click",function(e,t){ 
                  this.toggleClass("cMenuParentExpanded"); 
          }); 
     });
    when i do this, i can click on any item but it will only toggle the last item :S
    What i'm i doing wrong?

    Thanx!

  2. #2
    Ext User sosamv's Avatar
    Join Date
    Apr 2009
    Posts
    81
    Vote Rating
    0
    sosamv is on a distinguished road

      0  

    Default FIXED

    FIXED


    Got it working :S

    Code:
    arr = Ext.select('.cMenuParentCollapsed');
    
    arr.each(function(){
        this.on("click",function(evnt,html){
           Ext.get(html).toggleClass("cMenuParentExpanded");
        });
    });
    Is this the best way to do it?

  3. #3
    Touch Premium Member letssurf's Avatar
    Join Date
    Jan 2008
    Location
    Northampton, UK
    Posts
    88
    Vote Rating
    1
    letssurf is on a distinguished road

      0  

    Default


    It might also be a good idea to use one click handler and use the delegate option.

    Something like.
    Code:
    var handler = function(evnt, html){
      Ext.get(html).toggleClass("cMenuParentExpanded");
    };
    Ext.getBody().on('click', handler, scope, {delegate: '.cMenuParentCollapsed'})
    James Demspter

    the one constant in life, is change.

  4. #4
    Ext User sosamv's Avatar
    Join Date
    Apr 2009
    Posts
    81
    Vote Rating
    0
    sosamv is on a distinguished road

      0  

    Default Thanx!

    Thanx!


    Didnt know about that!, thanx!

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