Results 1 to 4 of 4

Thread: Using classes that extend a custom class

  1. #1
    Sencha Premium Member
    Join Date
    Nov 2012
    Posts
    34

    Default Using classes that extend a custom class

    Say I have a class myapp.view.Banana that is extended from myapp.view.Fruit, a custom class that is extended from Ext.Component. I can easily link Fruit into views by dragging it in the project inspector, but I can't do this with Banana.

    I created myapp.view.Banana using Project Inspector Menu->Class->Views and setting the extend property to myapp.view.Fruit. It has userAlias, and userClassName set. But I can't figure out how to get Architect to let me use its userAlias as an xtype to make an instance inside of another view. How can I do this?

    The version of Architect I'm using is 2.2.3.

  2. #2
    Sencha User
    Join Date
    Sep 2010
    Posts
    567

    Default

    You should be able to do this as follows:
    - Where you want to create an instance of Banana, insert a plain Component instead
    - Set that component's createAlias property to Banana's xtype/userAlias.

    This should get the code to reference the correct xtype. Unfortunately Architect's design view will just render the plain Component, so if your Fruit/Banana classes have custom rendering logic that won't be reflected until you save/preview your app.

  3. #3
    Sencha Premium Member
    Join Date
    Nov 2012
    Posts
    34

    Default

    Thanks so much for the response! I didn't know about createAlias.

  4. #4
    Sencha User
    Join Date
    Sep 2010
    Posts
    567

    Default

    I'm glad that worked for you.

    The createAlias is something we put in as a short-term workaround for Architect's inability to treat user classes the same as built-in classes. We do plan to bridge that gap and make them first-class citizens in the future, but we're not there yet.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •