extjs - Sencha Touch 2 - How to check if an item exists in the ViewPort -


What I want to do, basically, is to dynamically load views in the viewport when needed. For, I have to find out that the scene has already been added to the ViewPort, so it is not added multiple times. While looking at the Touch Touch documentation, I could not find a proper way to see if an item is present inside ViewPort.

So in summary

1 - See if the viewport is included in something I want to actively set something like this:

  if ( Extension.viewport.imes.us ('myviewtoactivate')) Ext.Viewport.add ([{xtype: 'myviewtoactivate'}]);  

2 - Then I will set this scene as active (I already know how to do this part).

Thanks for the help!

You can use something inside your controller:

  Var main = this.getMain (), Myview = main.down ('myview'); If (! Myview) {myview = main.add ({xtype: 'myview'}); }  

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -