jep
28 Apr 2012, 10:38 PM
I have an app with phone and tablet profiles. It has a view with a button that brings up another view. In the tablet version, this new view is simply a floating window shown next to the button. In the phone version, it is a whole screen that is switched to.
I'm trying to figure out what the best practice is for this situation. Is it to give each profile view a different xtype and then create two separate refs, one in each controller like:
phone controller:
myView:{
selector:'someViewPhone',
xtype:'someViewPhone',
autoCreate:true
},
tablet controller:
myView:{
selector:'someViewTablet',
xtype:'someViewTablet',
autoCreate:true
},
?
Then in the phone controller's click for the button:
Ext.Viewport.add(this.getMyView());
Ext.Viewport.setActiveItem(1);
and in the tablet controller:
this.getMyView().showBy(this.getMyButton());
?
Or is there some more elegant way to go about this?
I'm trying to figure out what the best practice is for this situation. Is it to give each profile view a different xtype and then create two separate refs, one in each controller like:
phone controller:
myView:{
selector:'someViewPhone',
xtype:'someViewPhone',
autoCreate:true
},
tablet controller:
myView:{
selector:'someViewTablet',
xtype:'someViewTablet',
autoCreate:true
},
?
Then in the phone controller's click for the button:
Ext.Viewport.add(this.getMyView());
Ext.Viewport.setActiveItem(1);
and in the tablet controller:
this.getMyView().showBy(this.getMyButton());
?
Or is there some more elegant way to go about this?