1. #1
    Sencha User
    Join Date
    Nov 2012
    Posts
    2
    Vote Rating
    0
    ed.clement is on a distinguished road

      0  

    Default Unanswered: Ext.tab.Panel > beforeadd event cannot be cancelled by returning false.

    Unanswered: Ext.tab.Panel > beforeadd event cannot be cancelled by returning false.


    I have the following code tied to the beforeaddevent of a tabpanel:
    Code:
    beforeadd: function(tabPanel, tab, index){
        tabPanel.items.items.map(function(item){
            if(item.$className === tab.$className){
                console.log('*****' + item.$className + '*****');
                 return false;
            }
        })
    }
    According to the documentation at:
    http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.tab.Panel-event-beforeadd
    .
    ..returning false should stop the event. It does NOT. The tab still gets added anyway.

  2. #2
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    16,828
    Answers
    453
    Vote Rating
    609
    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


    I can't reproduce this, please post a test case:

    Code:
    Ext.onReady(function() {
        
        var tabs = new Ext.tab.Panel({
            renderTo: document.body,
            width: 200,
            height: 100,
            items: [{
                title: 'Foo',
                html: 'foo'
            }]
        });
        
        tabs.on('beforeadd', function() {
            return false;
        });
        
        tabs.add({
            title: 'Bar',
            html: 'bar'
        });
        
    });
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  3. #3
    Sencha User
    Join Date
    Nov 2012
    Posts
    2
    Vote Rating
    0
    ed.clement is on a distinguished road

      0  

    Default


    It's a scope issue with the map function. Sorry. Feel free to close.

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