1. #1
    Sencha User
    Join Date
    May 2011
    Posts
    25
    Vote Rating
    0
    invalidoyt is on a distinguished road

      0  

    Question Answered: Implementing device profiles afterwards

    Answered: Implementing device profiles afterwards


    Hello,

    This is my first question in the forum although I have been around here reading the questions and answers for a while.

    I have constructed my app without profiles, it was a mistake. Now, I am trying to implement device profiles onto it, which causes pain. I need different views only for a few views. I want to use the current views through the app (generic views), excluding a view which shows detailed info. When the user chooses a list item, its detailed view is shown. Here, I want to separate the profiles to benefit from the screen better.

    How can I implement device profiles without reconstructing the app? Or, how can I add device profile support for a single view?

    One more question: I construct my app on a single controller. Other things are going on views. Is this a bad habit? If I separate the app for controllers, I imagine I would have 5 controllers with 3 views for each (to give you some predicted numbers to understand the scale of the app).
    Last edited by invalidoyt; 22 Mar 2012 at 8:28 AM. Reason: Explanatory title change

  2. If you need it for a single view then you can just check what type of device/os it is in that view.

    If you want to use profiles then you can add them in and in the launch method is just where you create the appropriate view.

  3. #2
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,641
    Vote Rating
    898
    Answers
    3573
    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


    If you need it for a single view then you can just check what type of device/os it is in that view.

    If you want to use profiles then you can add them in and in the launch method is just where you create the appropriate view.
    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.

  4. #3
    Sencha User
    Join Date
    May 2011
    Posts
    25
    Vote Rating
    0
    invalidoyt is on a distinguished road

      0  

    Default


    Thank you for your answer(s) -also for the tons of previous replies in other questions.

    Can you also suggest some for my other relatively small question? Is having single controller a bad practice?

  5. #4
    Sencha - Senior Forum Manager mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    37,641
    Vote Rating
    898
    Answers
    3573
    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


    It's not bad if you don't need others. Personally, I have one controller per feature of my app and if I only have one app then I could only have one controller. If I only have one controller I would split it up if either the file gets long or it is unorganized. Having multiple controllers doesn't affect performance in a noticeable way.
    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.

  6. #5
    Sencha User
    Join Date
    May 2011
    Posts
    25
    Vote Rating
    0
    invalidoyt is on a distinguished road

      0  

    Thumbs up


    Thank you!

    Hearing this made me feel more comfortable with my current structure.

    By the way, just tested your suggestion about device profiling. Managed it like this:

    Code:
    if(Ext.os.is.Phone)
    {
    Ext.define('App.view.HotelDetail', {
        extend: 'Ext.Panel',
        xtype: 'hoteldetailcard',
    	id: 'hotelDetailView',
        html: "for phone"
    .....
    }
    }
    else
    {
    Ext.define('App.view.HotelDetail', {
        extend: 'Ext.Panel',
        xtype: 'hoteldetailcard',
    	id: 'hotelDetailView',
         html: "for tablet"
    .....
    }
    }

Thread Participants: 1

Tags for this Thread