Results 1 to 4 of 4

Thread: Is there a list of all the created views?

  1. #1
    Sencha User
    Join Date
    Mar 2012
    Posts
    28

    Default Is there a list of all the created views?

    I was wondering if there is a place where you can see all views that get created using

    Code:
    Ext.create
    or is there a way to check if a view is already created by using its MyApp.view.ViewName?

  2. #2
    Sencha User
    Join Date
    Apr 2012
    Location
    New Jersey
    Posts
    1,149
    Answers
    132

    Default

    You can check to see if one is created by using the convention:
    if(MyApp.view.ViewName) //returns true if exists, false if undefined

    Or using the examples found in Ext.ComponentQuery

  3. #3
    Sencha User
    Join Date
    Mar 2012
    Posts
    28

    Default

    Quote Originally Posted by jerome76 View Post
    if(MyApp.view.ViewName) //returns true if exists, false if undefined
    how does this work? because MyApp.view.ViewName is a class? so when i do the if clausule, it returns a function.

    I think sencha touch is keeping a list somewhere in the application, which holds all the created views, for autodestroy etc.

  4. #4
    Sencha User
    Join Date
    Apr 2012
    Location
    New Jersey
    Posts
    1,149
    Answers
    132

    Default

    You can try using Ext.isDefined() inside the if condition, or trying to use Ext.ComponentQuery('component') to return all your created components.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •