1. #1
    Sencha User
    Join Date
    Feb 2013
    Posts
    17
    Vote Rating
    1
    Konzept-iX is on a distinguished road

      1  

    Default Implementing Senchas device profiles guide w/ Architect

    Implementing Senchas device profiles guide w/ Architect


    Hello,

    I'm trying to implement two device profiles (Phone, Tablet) and I've most likely found a guide that matches my needs, but I have trouble following this guide with Architect. The article I talk about is this one:
    http://docs.sencha.com/touch/2.0.2/#!/guide/profiles

    I wonder why some configuration properties like "profiles", which are I guess often used, are not showing up in Architect. Am I missing something?
    architect1.png

    After manually adding that property, setting its type to Array, i get code that looks like in the guide:
    Code:
    Ext.application({
        profiles: [
            'Phone',
            'Tablet'
        ],
        name: 'MyApp'
    });
    Not that much of a big deal so far. But my real problem is how to create the
    1) "folders"/"packages" where all my profile data should be in. I mean 'app/profile/' and then i.e. 'app/profile/tablet/' for the tablet views). The guide suggests the 'Mail.profile.tablet'. I'm quite stuck on how to get it like that, because I can only add things into Controllers, Views, Models and Resources?

    2) profiles (i.e. app/profile/Phone.js). I thought about adding a new class, edit the "extend" property to 'Ext.app.Profile'. Then again manually adding the "config" property and also a function (isActive) inside the class.
    architect2.png

    I'd like to know whether my approach is correct or this guide is already outdated. Or if there are another, better/easier approaches to this common functionality, please let me know. Probably I'm just missing something trivial again...

    Thanks!

  2. #2
    Touch Premium Member BostonMerlin's Avatar
    Join Date
    Aug 2010
    Location
    Boston
    Posts
    497
    Vote Rating
    41
    BostonMerlin has a spectacular aura about BostonMerlin has a spectacular aura about BostonMerlin has a spectacular aura about

      0  

    Default


    profile support has not made it into architect yet. i'm looking at profiles as well. latest recommendation from sencha is to do device type/size checks in your code until architect support is ready. l'm not privy to what's on their road map but i'm sure we'll hear something by senchacon.
    I love being a dad (5 & 7), flying airplanes (KBED) and writing code (spaghetti).
    BostonMerlin aka John Bond aka JB
    See U @ SenchaCon '13

  3. #3
    Sencha User
    Join Date
    Feb 2013
    Posts
    17
    Vote Rating
    1
    Konzept-iX is on a distinguished road

      0  

    Default


    Quote Originally Posted by BostonMerlin View Post
    profile support has not made it into architect yet. i'm looking at profiles as well. latest recommendation from sencha is to do device type/size checks in your code until architect support is ready. l'm not privy to what's on their road map but i'm sure we'll hear something by senchacon.
    Oh I see. That's unfortunate. Its a main functionality in my app.
    Can you elaborate on that device type checks?
    I'm kinda unsure what do you mean/hint to..

    Thanks!

  4. #4
    Touch Premium Member BostonMerlin's Avatar
    Join Date
    Aug 2010
    Location
    Boston
    Posts
    497
    Vote Rating
    41
    BostonMerlin has a spectacular aura about BostonMerlin has a spectacular aura about BostonMerlin has a spectacular aura about

      0  

    Default


    something like..... if screenWidth > 500 show menu on left, detail on right else just show menu etc..

    pretty much roll your own layout logic. I would encapsulate this logic into a central location so that when profile support is ready, the pain to refactor will be minimized.

    John
    I love being a dad (5 & 7), flying airplanes (KBED) and writing code (spaghetti).
    BostonMerlin aka John Bond aka JB
    See U @ SenchaCon '13

  5. #5
    Sencha User
    Join Date
    Feb 2013
    Posts
    17
    Vote Rating
    1
    Konzept-iX is on a distinguished road

      0  

    Default


    Quote Originally Posted by BostonMerlin View Post
    something like..... if screenWidth > 500 show menu on left, detail on right else just show menu etc..

    pretty much roll your own layout logic. I would encapsulate this logic into a central location so that when profile support is ready, the pain to refactor will be minimized.

    John
    Thanks for the fast response!
    What's the right place to implement that logic? I mean, when will this code be called?
    Sorry, this is probably a stupid question but I'm just getting into Architect / Touch...


    Btw, I stumbled over this link: http://www.sencha.com/learn/idiomatic-layouts-with-sencha-touch
    Seems pretty promising, but before I'll give that a try tomorrow, I'd like to ask if I'm going to waste my time trying to implement this with Architect.

  6. #6
    Touch Premium Member BostonMerlin's Avatar
    Join Date
    Aug 2010
    Location
    Boston
    Posts
    497
    Vote Rating
    41
    BostonMerlin has a spectacular aura about BostonMerlin has a spectacular aura about BostonMerlin has a spectacular aura about

      0  

    Default


    That link references Sencha Touch 1 (outside of Architect as well).

    How you approach this depends on how you want your app laid out for each screen size and orientation. If it were me, I would encapsulate logic within each view (views you want to change based on size/orientation). So on the init of a view I might say if width greater than x show Y or change the layout to hbox ... whatever works for your situation. Again, this code would live inside views you might want to change. I want each of my views to react 'on their own' to the environment they're placed in.

    For bigger picture layout changes like the layout of a menu on left, detail on right when on a large screen tablet vs just a menu with itemTaps that take you to the detail, i would perform in my controller.

    Hard to explain if you're just getting started but hopefully you get some sense of direction. Start out small, work your way up from there.

    Hope that helps
    John
    I love being a dad (5 & 7), flying airplanes (KBED) and writing code (spaghetti).
    BostonMerlin aka John Bond aka JB
    See U @ SenchaCon '13

Thread Participants: 1

Tags for this Thread

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