-
10 Nov 2008 6:06 AM #1
[2.2][CLOSED] Bug in Ext.Panel.onRender
[2.2][CLOSED] Bug in Ext.Panel.onRender
Line 687 - 693:
Notice the lineCode:if(this.tools){ var ts = this.tools; this.tools = {}; this.addTool.apply(this, ts); }else{ this.tools = {}; }
Obviously, Function.prototype.apply expects the second argument to be of type Array, but instead an object is passed, which will throw an error.Code:this.addTool.apply(this, ts);
Changing the line
toCode:this.addTool.apply(this, ts);
Will fix this issue.Code:this.addTool.apply(this, [ts]);
HTHATINCW
Thorsten
-
10 Nov 2008 6:41 AM #2Sencha - Community Support Team
- Join Date
- Mar 2007
- Location
- The Netherlands
- Posts
- 24,251
- Vote Rating
- 44
The API docs clearly state that the tools config option needs to be an Array (hence the plural: tools)!
-
10 Nov 2008 6:51 AM #3
-
3 Mar 2011 11:19 AM #4
No, really there is a bug in here
No, really there is a bug in here
I've been chasing down a problem in ExtJS 3.3.1, and it appears to be the same as the one reported here, except that it's the other half of the if statement.
In ExtJS 3.3.1, the code looks like this:
If you start with this.tools==undefined, then after the onRender code executes, this.tools will be equal to {}. If you ever need to re-render the object again (for example, if you change the contents of the panel, or even change its layout manager) then this.tools will be an illegal value!Code:if(this.tools){ ts = this.tools; this.elements += (this.header !== false) ? ',header' : ''; } this.tools = {};
Note that setting the config option for tools to "[]" doesn't help, because we are really talking about a panel that doesn't have a toolbar.
I'll keep looking to see if there is another discussion of this issue, but in the meantime, I thought it would be useful to append to this one.



Reply With Quote
