Hybrid View
-
3 Jan 2013 2:36 PM #1
Ext.define and Ext.create
Ext.define and Ext.create
Hello,
I understand that Ext.create will create an object of the class, however in sencha architect i find only Ext.define. Could someone please tell me why we don't have Ext.create?
Thanks
-
3 Jan 2013 4:13 PM #2
I think...
I think...
If I remember from when I tested it last (and please correct me if I'm wrong) you can only use Ext.Create in Architect in functions of the class....e.g. the init function, painted etc. You can also use it as an override if you override that class
-
4 Jan 2013 4:02 PM #3
Digeridoopoo's reply is correct. Architect is all about defining a set of classes and configurations. It's possible that within your own custom event handlers or controller logic you'll need to instantiate those classes, but it's up to you to write that logic.
Jason Johnston
@lojjic
Sencha Architect Development Team
-
4 Jan 2013 6:26 PM #4
Hello,
Thanks for the replies. Actually that part I understood..what I was asking is that, when we are defining anything, it is just there, right? No instance of the object is created yet..then how are we able to see it?
-
6 Jan 2013 5:43 PM #5
Think about it this way...
You drag a panel to the project inspector, name it "MyPanel", add useralias "mypanel" and define all the configs. You now have a class and can use this top level object by dragging it into another container or panel or viewport and then choose link. This creates the instantiated object in the containing object.
The link will use the user alias as xtype in the items array of the container.
This is the instantiated object you will see. You can change some configs in the link to override the ones in the class you created.Code:items: [ { xtype: "mypanel", height: 100, width: 200, ... more configs... }
Generally the first panel you drag becomes the initial view.
I hope this quick explaination makes sense.
Worth


Reply With Quote