View Full Version : Error when closing tab

27 Nov 2007, 7:17 AM
According to the Advanced Tab example I add tabs dynamically with a grid on it. When closing a tab it leads to the following errors:

element has no properties
if (element.removeEventListener) { ... prototype.js (line 3040)

And (probably as an after effect):

item has no properties
if(item.disabled){ ... ext-all-debug.js (line 18462)

Without the grid on it everything works fine. The grid looks like:

var grid = new Ext.grid.GridPanel({
store: ds,
view: new Ext.grid.GroupingView({
hideGroupedColumn: true,
showGroupName: false,
autoWidth: true,
height: 400,
trackMouseOver: true,
plugins: [ new Ext.grid.GroupSummary() ],
colModel: columnModel,
selModel: new Ext.grid.RowSelectionModel(),
loadMask: true

and is added in callback after loading the store:

title: title,
items: grid,

Does anybody see what's my mistake?
Thanks in advance for any hint!

27 Nov 2007, 9:33 AM
First, I wouldn't call show followed by doLayout. If you're using deferred rendering, they should be reversed. If you add the layoutOnTabChange config, you should not need to call doLayout at all.

It looks like you're using the prototype adapter - does this also occur if you switch to the base adapter?

28 Nov 2007, 1:43 AM
With base adapter it works fine! After updating prototype error message changed a bit:

element has no properties
if (element._eventID) return element._eventID;
prototype.js Line 3812

Don't know what to do now? Is it a bug or my fault?

(By the way, using layoutOnTabChange instead of doLayout was a good suggestion ;))

28 Nov 2007, 8:32 AM
If it works in the base adapter, but not prototype adapter, there's probably a bug. Has to be determined whether it's due to a change in the prototype lib that Ext hasn't accounted for, or something else. Please post in Bugs with a sample that shows the problem and include any relevant info related to prototype version you're using.