-
25 Apr 2011 9:18 AM #1
[FIXED-EXTJSIV-1814]Tab and beforeclose
[FIXED-EXTJSIV-1814]Tab and beforeclose
No response on event boforeclose. Use close button(closable:true).
-
27 Apr 2011 2:31 AM #2
-
28 Apr 2011 8:24 AM #3
-
28 Apr 2011 8:50 AM #4
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!
-
28 Apr 2011 12:52 PM #5
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).
In the component source:Code:new Ext.ux.devcomp.tab.Tab({ title: "Title", closable: true, listeners: { beforeclose: function() { // not firing } } });
I think something like the following is missing: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; } } },
Code:me.closeEl.on('click', me.onCloseClick());
-
28 Apr 2011 5:45 PM #6
I can't reproduce this:
Hit the close button, the event fires. Am I missing something?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!'); }); }); });Evan Trimboli
Sencha Developer
Twitter - @evantrimboli
Don't be afraid of the source code!
-
29 Apr 2011 8:41 AM #7
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: [ ... ] });
-
29 Apr 2011 10:11 AM #8
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 } } }] }); });
-
2 May 2011 12:28 AM #9
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!
Thank you for reporting this bug. We will make it our priority to review this report.
Similar Threads
-
[FIXED-EXTJSIV-1663][4 B3] hasGridView not used
By mankz in forum Ext:BugsReplies: 2Last Post: 24 Apr 2011, 9:04 PM -
[FIXED-EXTJSIV-1071] getRecords
By sora in forum Ext:BugsReplies: 5Last Post: 14 Apr 2011, 2:27 PM -
[FIXED-EXTJSIV-190] TabCloseMenu
By James Goddard in forum Ext:BugsReplies: 2Last Post: 7 Apr 2011, 5:35 AM -
[FIXED-EXTJSIV-593] Time Axis
By James Goddard in forum Ext:BugsReplies: 6Last Post: 5 Apr 2011, 3:40 PM -
[FIXED-EXTJSIV-240] ReadOnly combo bug
By wki01 in forum Ext:BugsReplies: 1Last Post: 26 Mar 2011, 8:42 PM


Reply With Quote