{"id":2928,"date":"2014-03-10T12:58:16","date_gmt":"2014-03-10T12:58:16","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/10\/dojo-cannot-read-property-h-of-undefined-on-accordioncontainer-js-collection-of-common-programming-errors\/"},"modified":"2014-03-10T12:58:16","modified_gmt":"2014-03-10T12:58:16","slug":"dojo-cannot-read-property-h-of-undefined-on-accordioncontainer-js-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/10\/dojo-cannot-read-property-h-of-undefined-on-accordioncontainer-js-collection-of-common-programming-errors\/","title":{"rendered":"Dojo : Cannot read property &#39;h&#39; of undefined on AccordionContainer.js?-Collection of common programming errors"},"content":{"rendered":"<p>I am getting an error like this when I created Two accordion containers dynamically under an accordion container.<\/p>\n<p>The error will not happens when I created any of these single accordion container instead of create both together.<\/p>\n<blockquote>\n<p>Error :<\/p>\n<p><strong>Cannot read property &#8216;h&#8217; of undefined on AccordionContainer.js<\/strong><\/p>\n<\/blockquote>\n<p>I have temporarily fix the problem by adding these lines to tool kit file, dojo-toolkit\\dijit\\layout\\AccordionContainer.js<\/p>\n<pre><code>Line 91: + if(this._contentBox) \nLine 92:    this._verticalSpace=_34.h-_35-_2f.h-_30.h-_32.h-_33.h-_2d._buttonWidget.getTitleHeight(); \nLine 93: + if(this._contentBox) \nLine 94:    this._containerContentBox={h:this._verticalSpace,w:this._contentBox.w-_2f.w-_30.w-_32.w- _33.w}; \n<\/code><\/pre>\n<p><strong>Accordion Widget creation code structure is<\/strong><\/p>\n<pre><code>define(\"test\/project\", [ \n        \"dojo\/_base\/declare\", \n        \"dijit\/_Widget\", \n        \"dijit\/layout\/AccordionContainer\"], \n    function(declare, _Widget, AccordionContainer) { \n        return declare([_Widget],{ \n                         postCreate: function() { \n                                var new_acc = new AccordionContainer({ \n                                        id: \"new_acc\", \n                                        title: \"Approval (\"+this.count+\")\" \n                                }); \n\n                               this.parentId.addChild(new_acc); \n                        } \n        });     \n}); \n<\/code><\/pre>\n<p>Any idea to solve this issue?<\/p>\n<p>Thanks in advance&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &#8216;h&#8217; of undefined on AccordionContainer.js I have temporarily fix the problem by adding [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-2928","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2928","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=2928"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/2928\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=2928"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=2928"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=2928"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}