Dojo : Cannot read property 'h' of undefined on AccordionContainer.js?-Collection of common programming errors
I am getting an error like this when I created Two accordion containers dynamically under an accordion container.
The error will not happens when I created any of these single accordion container instead of create both together.
Error :
Cannot read property ‘h’ of undefined on AccordionContainer.js
I have temporarily fix the problem by adding these lines to tool kit file, dojo-toolkit\dijit\layout\AccordionContainer.js
Line 91: + if(this._contentBox)
Line 92: this._verticalSpace=_34.h-_35-_2f.h-_30.h-_32.h-_33.h-_2d._buttonWidget.getTitleHeight();
Line 93: + if(this._contentBox)
Line 94: this._containerContentBox={h:this._verticalSpace,w:this._contentBox.w-_2f.w-_30.w-_32.w- _33.w};
Accordion Widget creation code structure is
define("test/project", [
"dojo/_base/declare",
"dijit/_Widget",
"dijit/layout/AccordionContainer"],
function(declare, _Widget, AccordionContainer) {
return declare([_Widget],{
postCreate: function() {
var new_acc = new AccordionContainer({
id: "new_acc",
title: "Approval ("+this.count+")"
});
this.parentId.addChild(new_acc);
}
});
});
Any idea to solve this issue?
Thanks in advance…