1. #11
    Sencha User jep's Avatar
    Join Date
    Sep 2010
    Posts
    862
    Vote Rating
    21
    jep will become famous soon enough jep will become famous soon enough

      0  

    Default


    Quote Originally Posted by edspencer View Post
    The main downside of this approach is exactly what you've just pointed out - you can't overload the xtypes in this manner. It's something I'd like us to come up with a better solution around in the next minor release or two, and would welcome ideas and feedback.
    Any progress on this, Ed? This is probably one of the roughest areas of the API design to me. You can do marvelous things designing your interface in separate files as object configs. But then when you go to use multiple profiles, there's simply a big gap in the road that you have to build your own bridge to. Every time.

    It seems like Controllers already work the way we'd expect them to. The API knows to prune off the inactive profile-specific controllers and treat them as "dead" code. I really wish it'd do the same thing for inactive profile-specific views (and I suppose models and stores).

    As you noted, all the code has to be in the app. But the API doesn't have to pay attention to all of it if it ties in with the profiles at all levels.

  2. #12
    Sencha - Community Support Team edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939
    Vote Rating
    7
    edspencer is a jewel in the rough edspencer is a jewel in the rough edspencer is a jewel in the rough

      0  

    Default


    Hey jep, I actually left Sencha a few months back so not totally clued in on the current state of things... I see 2.1 just went GA so maybe there's something in there.

    Agreed that it's the worst part of MVC at the moment - it's probably the only part of that stack that I would have liked to have fixed before I moved on.
    Ext JS Senior Software Architect
    Personal Blog: http://edspencer.net
    Twitter: http://twitter.com/edspencer
    Github: http://github.com/edspencer

  3. #13
    Sencha User jep's Avatar
    Join Date
    Sep 2010
    Posts
    862
    Vote Rating
    21
    jep will become famous soon enough jep will become famous soon enough

      0  

    Default


    Ah, I see, Ed. Well, thanks for the update. I'm poking around in the guts of the code right now to see if there's anything I can hack in to prune out the unused profiles. But I'm sure you're even more aware than I am of how nitty-gritty that code can get!

  4. #14
    Sencha User jep's Avatar
    Join Date
    Sep 2010
    Posts
    862
    Vote Rating
    21
    jep will become famous soon enough jep will become famous soon enough

      0  

    Default


    Well, I never could figure out a way to fix it at the framework level. The code is just too complicated and seems like it would take some major work. So here's my hack:

    Code:
    //<debug>
    Ext.Loader.setPath({
        'Ext': 'touch/src',
        'default': 'app'
    });
    //</debug>
    
    var profiles;
    
    if (window.location.search.indexOf('profile1') !== -1) {
        profiles = ['profile1'];
    }
    else {
        profiles = ['profile2'];
    }
    
    Ext.application({
        profiles: profiles,
    
        name: 'TestApp',
    I basically do all my testing for which profile(s) should be loaded right there in the app.js. For this simple test I used URL params but you'd do similar by using Ext.os.is('iPad') or whatever.

  5. #15
    Sencha - Community Support Team edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939
    Vote Rating
    7
    edspencer is a jewel in the rough edspencer is a jewel in the rough edspencer is a jewel in the rough

      0  

    Default


    The issue (as I recall, it was a while back now so my recollection could be rusty) comes when it's time to build the app for production. The way profiles originally worked was that they'd only load the files they need, rather than loading everything. Unfortunately this means you need one build for each Profile, and some logic somewhere that replicates the profile detection system and serves up the right build.

    Having everything load for all profiles alleviates these problems, but causes that annoying xtype overloading issue. The way I saw it when I implemented it is that this is the lesser of two evils but it still grates...
    Ext JS Senior Software Architect
    Personal Blog: http://edspencer.net
    Twitter: http://twitter.com/edspencer
    Github: http://github.com/edspencer

  6. #16
    Sencha User jep's Avatar
    Join Date
    Sep 2010
    Posts
    862
    Vote Rating
    21
    jep will become famous soon enough jep will become famous soon enough

      0  

    Default


    Right, I fully understand the "one build for all" concept. You have to load all the code into memory. However, the API then does a lot of stuff to process that code (such as building the xtype map). What I'm suggesting is that you check the profiles before processing the profile-dependent code. That code can be effectively "pruned" at runtime, if you structure the API to do so.

    Check out my workaround above for a very crude way of doing the pruning.

  7. #17
    Sencha - Community Support Team edspencer's Avatar
    Join Date
    Jan 2009
    Location
    Palo Alto, California
    Posts
    1,939
    Vote Rating
    7
    edspencer is a jewel in the rough edspencer is a jewel in the rough edspencer is a jewel in the rough

      0  

    Default


    Yup makes sense. The class system actually handles all of that logic - from loading the file onto the page to actually constructing the class (at which point the xtype is registered). There would need to be some way to have the class loaded but not parsed by the class system to enable this to work. Something to ask Jacky for I think
    Ext JS Senior Software Architect
    Personal Blog: http://edspencer.net
    Twitter: http://twitter.com/edspencer
    Github: http://github.com/edspencer

  8. #18
    Sencha User jep's Avatar
    Join Date
    Sep 2010
    Posts
    862
    Vote Rating
    21
    jep will become famous soon enough jep will become famous soon enough

      0  

  9. #19
    Sencha User
    Join Date
    Sep 2012
    Posts
    13
    Vote Rating
    2
    andyjv is on a distinguished road

      0  

    Default


    I too, share the thoughts in this thread. It seems like the current implementation virtually defeats the spirit and purpose of Profiles in specific and Sencha Touch as a whole.

  10. #20
    Sencha User
    Join Date
    Dec 2007
    Posts
    16
    Vote Rating
    0
    kisscool82 is on a distinguished road

      0  

    Default


    Same issue for me.
    I tried jep's hack but it still does'nt work.

    Changing the xtypes with profile name cause bugs with refs in the controllers and dynamic views creation. I can't refactore the entire code of my apps. If the solution is to write entire code for each profiles, it's not the profile spirit anymore...

    What's the solution please ?
    Is there an update in the framework ?

    Thx

film izle

hd film izle

film sitesi

takipci kazanma sitesi

takipci kazanma sitesi

güzel olan herşey

takipci alma sitesi

komik eğlenceli videolar