{"id":3105,"date":"2014-03-16T20:28:15","date_gmt":"2014-03-16T20:28:15","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/16\/custom-component-reuse-with-extjs4-collection-of-common-programming-errors\/"},"modified":"2014-03-16T20:28:15","modified_gmt":"2014-03-16T20:28:15","slug":"custom-component-reuse-with-extjs4-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/16\/custom-component-reuse-with-extjs4-collection-of-common-programming-errors\/","title":{"rendered":"custom component reuse with extjs4-Collection of common programming errors"},"content":{"rendered":"<p>I have created a custom grid in a javascript file. I want to use it as a xtype on to different panels in seperate js files. If I use it on a single panel, it works fine; but when I use try it use it on different panels at the same time, I get a error in the chrome developer tool console saying:<\/p>\n<pre><code>Uncaught TypeError: Cannot read property 'isComponent' of undefined \n<\/code><\/pre>\n<p>My grid definition is as follows:<\/p>\n<pre><code>Ext.define('DataBox.view.FootNotes', {\n    extend : 'Ext.grid.Panel',\n    alias : 'widget.footNotes',\ninitComponent : function() {\n    this.columns = [ {\n        header : 'SL', \n        field : {\n            xtype : 'checkbox',\n            checked : 'true'\n        }\n    }, {\n        header : 'Symbol',\n    }, {\n        header : 'Notes', \n    }, ];\n    this.callParent(arguments);\n}\n<\/code><\/pre>\n<p>});<\/p>\n<p>and to include the grid on the panels i use following code<\/p>\n<pre><code>initComponent : function() {\n    \/*  this.footNotesInfoGrid = Ext.create('DataBox.view.FootNotes', {\n        colspan: 2,\n        border: false,\n        frame: 'false'\n    }); even tried this *\/\n\n    Ext.apply(this,{\n        items : [{\n            xtype : 'footNotes',\n            columnWidth : .50,\n            id : 'infoFootNotesGrid',\n        }]\n    }\n   }\n<\/code><\/pre>\n<p>I tried many other ways suggested on different forum discussions.. but my problem stil persists. Can somebody point out where I am going wrong?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have created a custom grid in a javascript file. I want to use it as a xtype on to different panels in seperate js files. If I use it on a single panel, it works fine; but when I use try it use it on different panels at the same time, I get a [&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-3105","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3105","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=3105"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3105\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}