Thank you for reporting this bug. We will make it our priority to review this report.
  1. #1
    Sencha User
    Join Date
    Apr 2011
    Posts
    5
    Vote Rating
    0
    ermoha is on a distinguished road

      0  

    Default [FIXED-EXTJSIV-1814]Tab and beforeclose

    [FIXED-EXTJSIV-1814]Tab and beforeclose


    No response on event boforeclose. Use close button(closable:true).

  2. #2
    Sencha User
    Join Date
    Apr 2011
    Posts
    5
    Vote Rating
    0
    ermoha is on a distinguished road

      0  

    Default


    In finally release extjs 4 error was saved.

  3. #3
    Sencha User
    Join Date
    Apr 2011
    Posts
    5
    Vote Rating
    0
    ermoha is on a distinguished road

      0  

    Default


    setClosable() undefined

  4. #4
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,065
    Vote Rating
    659
    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'm not really sure on what you're saying, can you please post a short test case?
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  5. #5
    Ext JS Premium Member
    Join Date
    Jan 2008
    Posts
    12
    Vote Rating
    0
    cadorn is on a distinguished road

      0  

    Default Tab.tab.Tab -> listeners -> [beforeclose|close]

    Tab.tab.Tab -> listeners -> [beforeclose|close]


    The 'close' and 'beforeclose' events are not firing on the Tab.tab.Tab component (ExtJS 4).

    Code:
    new Ext.ux.devcomp.tab.Tab({
      title: "Title",
      closable: true,
      listeners: {
        beforeclose: function()
        {
          // not firing
        }
      }
    });
    In the component source:

    Code:
        syncClosableElements: function () {
            var me = this;
    
            if (me.closable) {
                if (!me.closeEl) {
                    me.closeEl = me.el.createChild({
                        tag: 'a',
                        cls: me.baseCls + '-close-btn',
                        href: '#',
                        html: me.closeText,
                        title: me.closeText
                    }).on('click', Ext.EventManager.preventDefault);  // mon ???
                }
            } else {
                var closeEl = me.closeEl;
                if (closeEl) {
                    closeEl.un('click', Ext.EventManager.preventDefault);
                    closeEl.remove();
                    me.closeEl = null;
                }
            }
        },
    I think something like the following is missing:

    Code:
    me.closeEl.on('click', me.onCloseClick());

  6. #6
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,065
    Vote Rating
    659
    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:

    Code:
    Ext.onReady(function() {
        
        var tabs = Ext.create('Ext.tab.Panel', {
            width: 200,
            height: 200,
            renderTo: document.body,
            items: [{
                title: 'A',
                closable: true
            }, {
                title: 'B',
                closable: true
            }]    
        });
        
        tabs.items.each(function(tab){
            tab.tab.on('beforeclose', function(){
                console.log('closing!');    
            });
        });
    });
    Hit the close button, the event fires. Am I missing something?
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

  7. #7
    Ext JS Premium Member
    Join Date
    Jan 2008
    Posts
    12
    Vote Rating
    0
    cadorn is on a distinguished road

      0  

    Default


    Maybe it is because I am using the tab panel within a top toolbar?

    Code:
    new Ext.panel.Panel({
        layout: "card",
        border: 0,
        tbar: new Ext.toolbar.Toolbar({
            border: 0,
            items: [
                (tabs = new Ext.tab.Panel({
                    enableTabScroll: true,
                    activeTab: 0,
                    width: "100%",
                    items: [
                        {
                            title: "title",
                            closable: true,
                            listeners: {
                                beforeclose: function()
                                {
                                    // not firing
                                }
                            }
                        }
                    ]
                }))
            ]
        }),
        items: [
           ...
        ]
    });

  8. #8
    Sencha User
    Join Date
    Apr 2011
    Posts
    5
    Vote Rating
    0
    ermoha is on a distinguished road

      0  

    Default


    Code:
    Ext.onReady(function() {
        
        var tabs = Ext.create('Ext.tab.Panel', {
            width: 200,
            height: 200,
            renderTo: document.body,
            items: [{
                title: 'A',
                closable: true,
                listeners:{
                beforeclose:function(){
                             //not fire, in ext 3 fire
                      }
                 }
            }]    
        });
        
      
    });

  9. #9
    Sencha - Ext JS Dev Team evant's Avatar
    Join Date
    Apr 2007
    Location
    Sydney, Australia
    Posts
    17,065
    Vote Rating
    659
    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


    Ok, I'm with you now. In the next version the beforeclose/close will fire on the panel itself, with the ability to veto the event by returning false in beforeclose.
    Evan Trimboli
    Sencha Developer
    Twitter - @evantrimboli
    Don't be afraid of the source code!

Similar Threads

  1. Replies: 2
    Last Post: 24 Apr 2011, 9:04 PM
  2. [FIXED-EXTJSIV-1071] getRecords
    By sora in forum Ext:Bugs
    Replies: 5
    Last Post: 14 Apr 2011, 2:27 PM
  3. [FIXED-EXTJSIV-190] TabCloseMenu
    By James Goddard in forum Ext:Bugs
    Replies: 2
    Last Post: 7 Apr 2011, 5:35 AM
  4. [FIXED-EXTJSIV-593] Time Axis
    By James Goddard in forum Ext:Bugs
    Replies: 6
    Last Post: 5 Apr 2011, 3:40 PM
  5. [FIXED-EXTJSIV-240] ReadOnly combo bug
    By wki01 in forum Ext:Bugs
    Replies: 1
    Last Post: 26 Mar 2011, 8:42 PM

Thread Participants: 2