View Full Version : Some guidance in setting multiple device profiles for MVC app.

22 Jan 2012, 10:39 AM
Hey gang,

I've been scouring these forums and Stack/O for some examples on how to setup multiple profiles/views for each device/orientation profile I setup.

I initially followed the example in the "Idiomatic Layouts ..." parts 1 and 2 guide and was able to get my simple demo working perfectly. When I tried to implement the same functionality into an MVC based app - I was at a total loss as to where most of the code and functions should go.

Ideally I'm looking to create one app which allows me to reuse pages if the layout works for both Mobile/Tablet in either orientation (Port/Land) using only responsive/css for layout - however there will be some pages/views in which I would like to have device/orientation specific views for.

At this point I'm at a complete loss as to where to 'put' all of the required code... and what code to use to accomplish this. I have the profiles in the Ext.Application but should the Controller detect and manage the views? Should there be a empty Card/View which is called by the controller and loads the respective views to itself for each 'Page'

There seems to be very little documentation on profiles/setProfile .. and I'm not experienced enough to pick the most efficient procedure in which to do this and cannot seem to grasp the overall concept here.

Does anyone having an example of this, or a basic idea on the best methods to handle this ... any help at all would be most appreciated!


23 Jan 2012, 8:47 AM
When you get your profiles setup and a profile is switched then the views will get their setProfile method executed. You can either do the presentation changes there or use Ext.dispatch to do something in a controller.

23 Jan 2012, 10:00 AM
Hi Mitchell - Thank you for the response.

Do you have, or is there an example of the setProfile method in the view panels? This is where I seem to be at a real loss.

I've also tried (to the best of my knowledge) the ext.dispatch -> controller method but find that if I switch to another unrelated card/view these orientation specific views are still being monitored and show up front-and-center whenever the the orientation switches.

I'm a bit embarrassed about how basic my understanding of this is .. I've been waiting for that 'lightbulb' moment when everything clicks together.

Thanks for any insight you can provide on this ...