-
4 Jan 2013 10:08 AM #1
Can I extend saved components???
Can I extend saved components???
Can I extend saved components in Architect?
Say I create a new component and add some configs and methods. I then save this component to the toolbox.
How can I use this component in the project by using it as a base component and extending it into more new components?
I'd like to drag it to the inspector and have it create a new object extending my original one.
Is this possible? Or am I barking up the wrong tree?
Worth
-
4 Jan 2013 3:48 PM #2
Unfortunately this is not yet possible in Architect. You are also unable to extend top-level components in the inspector, which is essentially the same thing. We do have plans to fully support deep extension of project classes in a near future release, though it won't be in the upcoming 2.2.
Jason Johnston
@lojjic
Sencha Architect Development Team
-
7 Jan 2013 1:34 PM #3
If I cannot extend components yet, is there a way where I could add an item to view by xtype in Architect?
I'll define the components manually and then add them as a resource.
It would be nice to have a item in the toolbox like "generic item" or "xType" component or whatever it should be called.
Upon dragging this item from the toolbox to a existing component in the project inspector they would be added to the items array like this:
This item could not be a top level item and would only be added to components with an items array.Code:{ xtype: 'mycustomwhatever' }
"xtype" could be the only required config.
All the rest of the config items would be custom as Architect does not know what is in that item.
But I do!
Worth
-
7 Jan 2013 1:40 PM #4
As it turns out, we're introducing something very much like that in the upcoming 2.2 release. When you add a child component, you can specify a 'createAlias' which essentially overrides the xtype in its config object in the generated code. A screenshot:
Screen Shot 2013-01-07 at 2.37.25 PM.pngJason Johnston
@lojjic
Sencha Architect Development Team
-
7 Jan 2013 1:51 PM #5
GREAT!
This is something I've needed.
Any time soon?
Worth
-
31 Mar 2013 9:15 PM #6
createAlias is now in Architect 2.2
createAlias is now in Architect 2.2
createAlias is now in Architect 2.2
-
1 Apr 2013 2:19 AM #7
And it works good!
NOTE: If you have a top level item in the inspector, createAlias does not show up. Child items will have this config property.
For example, drag a toolbar to the view area. No createAlias property.
Then drag a button to the toolbar. This button will have a createAlias property and you can use a component save in a file somewhere and pointed to by the loader path.
Worth


Reply With Quote