PDA

View Full Version : [FIXED-511][3.1] Closing a tab with menu open causes dom error



mprice
1 Feb 2010, 1:31 PM
If a closable tab contains a tbar with a menu, and the menu is open, and then the tab is closed, a demo error is thrown. You can reproduce by adding the highlighted code below to the advanced tabs sample. This issue did not occur in 3.0, and still appears to be an issue in the 3.1.1 beta.



/*!
* Ext JS Library 3.1.0
* Copyright(c) 2006-2009 Ext JS, LLC
* licensing@extjs.com
* http://www.extjs.com/license
*/
Ext.onReady(function(){

var tabs = new Ext.TabPanel({
renderTo:'tabs',
resizeTabs:true, // turn on tab resizing
minTabWidth: 115,
tabWidth:135,
enableTabScroll:true,
width:600,
height:250,
defaults: {autoScroll:true},
plugins: new Ext.ux.TabCloseMenu()
});

// tab generation code
var index = 0;
while(index < 7){
addTab();
}
function addTab(){
tabs.add({
title: 'New Tab ' + (++index),
iconCls: 'tabs',
html: 'Tab Body ' + (index) + '<br/><br/>'
+ Ext.example.bogusMarkup,
closable:true,
tbar: [{
text: 'test',
menu: [{text: 'test'}]
}]
}).show();
}

new Ext.Button({
text: 'Add Tab',
handler: addTab,
iconCls:'new-tab'
}).render(document.body, 'tabs');
});


Open the menu inside any of the tabs, and then attempt to close that tab with the menu still open. The following error is received. I get this error in IE 8 and FF 3.6, but not in Chrome 5.0.

Message: 'dom' is null or not an object
Line: 7
Char: 46976
Code: 0
URI: http://asnb0092/testing/EXTJS311/ext-all.js

See this jing for a recording of the issue:

http://screencast.com/t/NzU2MTYxYz

Jamie Avins
1 Feb 2010, 1:44 PM
Dupe of issue 438, fixed in svn 5928 for release in 3.1.1.

mprice
1 Feb 2010, 2:14 PM
I pulled down latest from SVN and retested, and the error no longer occurs. However, now I get an error when opening the menu on the next tab after closing the first tab. This only happens if I close the first tab with the menu open. Here is a recording of the new error:

http://screencast.com/t/NGNiNmM1Y

Jamie Avins
1 Feb 2010, 2:34 PM
Fixed in svn 5974 for release with 3.1.1