28 Mar 2012 12:46 AM #1
Unanswered: Create instance for User Defined Class not working for the first time
I have defined a class which extend from 'Ext.form.Panel'. It has many form fields (fieldcontainer, textboxes, checkboxes, radiobuttons, etc...). I am using Ext.create('MyClass') to instantiate the class.
Here, this instantiating the class is not working for the time. It says 'Object expected'. As per the documentation, Ext.create will work as synchronously.
I am not sure where the problem is.
28 Mar 2012 2:09 AM #2
you sure "object expected" is raised in the line that calls Ext.create ?
usually Ext.create will raise something like "this class hasnt been loaded... " or "couldnt find file ..." something like that.
and (i think) to avoid misterious loading problems just adds your files like any js to your html. At the end even sencha/extjs docs tells you loading dinamically is just for development but you have to build a file and then add it like any other js to your html.
this will help debug better also since recognize file names and lines and stuff and most of it its parsed by the browser before using it.
28 Mar 2012 4:42 AM #3
28 Mar 2012 5:52 AM #4
if you have the ext.loader enabled, make sure to require your custom class using the requires config at a place that makes sense (e.g. the parent container).Best regards
S-CIRCLES Social Network Engine
28 Mar 2012 6:19 AM #5
28 Mar 2012 9:55 AM #6
are you doing this inside an Ext Application ? or inside a onReady ?
if its inside onReady you need to tell to Ext.Loader where is located "studends" using setPath
28 Mar 2012 10:34 PM #7
30 Mar 2012 4:10 AM #8
Thanks for info.
But I could not use 'requires' config parameter since, I have a lot of classes to be loaded in a class. If those all are mentioned in 'requires', the parent class will be heavily.
Once again I will face the same issue with class which has a lot of classes mentioned in 'requires'.
3 Apr 2012 4:58 AM #9
Any solution for this?