1. #1
    Touch Premium Member senchito's Avatar
    Join Date
    Aug 2011
    Location
    Montreal, QC
    Posts
    27
    Vote Rating
    0
    senchito is on a distinguished road

      0  

    Default Unanswered: any replacement for Ext.reg() ? I prefered that to using aliases

    Unanswered: any replacement for Ext.reg() ? I prefered that to using aliases


    My project has over 200 views.. and most views are duplicated in their naming because there is a landscape and a portrait view for each.

    Previously I was able to use the Ext.Reg() to register my custom class using it's full name.

    For example I would create a new class

    app.view.containers.landscape.carousel.UnicornAndRainbows = Ext.extend(Ext.Panel, {
    ...
    });

    and at the bottom I would add this:

    Ext.reg('app.view.containers.landscape.carousel.UnicornAndRainbows', Wicked.view.containers.landscape.carousel.MoviesRelatedScenes);

    Which allowed me to use
    xtype: "app.view.containers.landscape.carousel.UnicornAndRainbows",

    when I wanted to use it.. which I found VERY convenient because it's clear even if a bit lengthy

    Now... it looks like Ext.reg is deprecated? So I have to use an alias "alias: 'widget.myAlias'" and then use "myAlias" when I want to use my xtype. This is inconvenient because it means I have to create new names for all of my 200+ views. I can't just use my class name "UnicornAndRainbows" because then it will conflict with the class of the same name in my portrait views... you understand?

    I use both app.view.containers.landscape.carousel.UnicornAndRainbows and app.view.containers.portrait.carousel.UnicornAndRainbows

    In fact in some cases I also use app.view.containers.landscape.panel.UnicornAndRainbows

    I really liked being able to use the full class name when refering to it and not some shortened alias... any solution?

    I'm sorry if I use the wrong terms sometimes... I've only been working with Sencha Touch for 2 months (full time 40 hours per week) and I'm still confused about a lot of things.

  2. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,790
    Answers
    3465
    Vote Rating
    833
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    What's wrong with using the alias config? There is also the xtype config.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Touch Premium Member senchito's Avatar
    Join Date
    Aug 2011
    Location
    Montreal, QC
    Posts
    27
    Vote Rating
    0
    senchito is on a distinguished road

      0  

    Default


    I think I clearly explained what's my gripe with it.. but to sum it up.. I prefered Ext.reg() because I could use the SAME name as my class' name

    Whereas now... I have to make up a NEW identifier... with 200 classes.. that's 200 new identifies that I need to remember.. which is very inconvenient.

    Code:
    Ext.define('app.view.containers.landscape.Master', {
        extend: 'Ext.Container',
       alias : "widget.app.view.containers.landscape.Master",
        xtype : "app.view.containers.landscape.Master",
    The code above is not valid.. I get a "invalid unique id of object" error if I try to do this. That means that when creating a new instance of my class or inserting it in one of my components.. I can't use the full class name to refer to it. Before I could

    Before I could go

    items: [{
    xtype: "app.view.containers.landscape.Master",
    }]

    but now I have to set up a different alias (without periods in the name) for each of my classes and that is VERY inconvenient.

    So... is there any way around this so I can use my class full name when refering to it instead of a shortened alias/xtype config?

  4. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,790
    Answers
    3465
    Vote Rating
    833
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    That has nothing to do with alias or xtype or even if Ext.reg would have been kept... ComponentQuery will not work with an xtype with periods.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  5. #5
    Touch Premium Member senchito's Avatar
    Join Date
    Aug 2011
    Location
    Montreal, QC
    Posts
    27
    Vote Rating
    0
    senchito is on a distinguished road

      0  

    Default


    oh ok

    well all I know is that with ST 1.0 and 1.1 it did work. I use the full class name (with periods) to create all my components and it works... now it doesn't work anymore and that makes me sad

  6. #6
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    36,790
    Answers
    3465
    Vote Rating
    833
    mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute mitchellsimoens has a reputation beyond repute

      0  

    Default


    Quote Originally Posted by senchito View Post
    oh ok

    well all I know is that with ST 1.0 and 1.1 it did work. I use the full class name (with periods) to create all my components and it works... now it doesn't work anymore and that makes me sad
    Yeah... this was exposed in Ext JS 4... I personally replace the periods with underscores ( '_' ) and it works for me. Used to periods but have to remain flexible.
    Mitchell Simoens @SenchaMitch
    Sencha Inc, Senior Forum Manager
    ________________
    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  7. #7
    Touch Premium Member senchito's Avatar
    Join Date
    Aug 2011
    Location
    Montreal, QC
    Posts
    27
    Vote Rating
    0
    senchito is on a distinguished road

      0  

    Default


    anyway... I guess I just found a way to get around the problem.

    I simply created a custom function that strips the periods, it's not pretty but it works and saves me loads of work

    Code:
    Ext.define('myApp.view.containers.landscape.Master', {
        extend: 'Ext.Container',
        xtype : xtype("myApp.view.containers.landscape.Master"),
    Code:
            items: [
                {
                    xtype: xtype('myApp.view.containers.landscape.Master'),
                },
            ],
    Code:
    function xtype(str) {
        return str.replace(/\./g, "");
    }

  8. #8
    jay@moduscreate.com's Avatar
    Join Date
    Mar 2007
    Location
    Frederick MD, NYC, DC
    Posts
    16,353
    Answers
    102
    Vote Rating
    79
    jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all jay@moduscreate.com is a name known to all

      0  

    Default


    Quote Originally Posted by senchito View Post
    anyway... I guess I just found a way to get around the problem.

    I simply created a custom function that strips the periods, it's not pretty but it works and saves me loads of work

    Code:
    Ext.define('myApp.view.containers.landscape.Master', {
        extend: 'Ext.Container',
        xtype : xtype("myApp.view.containers.landscape.Master"),
    Code:
            items: [
                {
                    xtype: xtype('myApp.view.containers.landscape.Master'),
                },
            ],
    Code:
    function xtype(str) {
        return str.replace(/\./g, "");
    }
    That looks pretty ugly. I agree that Xtypes for complex apps should be named after the class, but your approach s not clean, IMHO.

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi