1. #1
    Sencha User
    Join Date
    Jan 2012
    Posts
    13
    Vote Rating
    0
    joseph.piron is on a distinguished road

      0  

    Question Unanswered: How to have Ext.Loader to reload an already loaded view ?

    Unanswered: How to have Ext.Loader to reload an already loaded view ?


    Hi guys !

    For a new application we are setting up here we chose to try extjs, and it's impressive (but not so easy at first .
    Anyway, for this app, we need some kind of customizable dashboard feature and to get this we tried with a concept of view defined dashboards that user can create. And so, we'd like to be able to reload a particular view to get any new layout etc..

    I am using the Loader system and tried this:
    - get the view
    - destroy it
    - set Ext.Loader.isFileLoaded.[viewclassname] to false
    - null the var
    - Ext.create([viewclassname])

    but the system does not reload the view from server, only recreate an instance.
    Is there a way to do this ?

    Thanks in advance for your support !!

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


    Why are you wanting to reload a class definition?
    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.

  3. #3
    Sencha User
    Join Date
    Jan 2012
    Posts
    13
    Vote Rating
    0
    joseph.piron is on a distinguished road

      0  

    Default


    Hmm.. because I need to..
    Because I want to have the possibility to let users here modify class definition and then reload them in the remote interface. Another possibility would be to create a simple view, and have a config shared, but I want to pass by the trouble to create a new interface etc..

  4. #4
    Sencha Premium Member
    Join Date
    Apr 2011
    Posts
    101
    Answers
    8
    Vote Rating
    3
    sskow200 is on a distinguished road

      0  

    Default


    Code:
    Ext.Loader.syncRequire('MyApp.view.MyView');
    This should reload the class definition. Or am I missing something?

  5. #5
    Sencha User
    Join Date
    Jan 2012
    Posts
    13
    Vote Rating
    0
    joseph.piron is on a distinguished road

      0  

    Default


    Hmm it seems not to reload it if it was already loaded.. ?

  6. #6
    Sencha Premium Member
    Join Date
    Apr 2011
    Posts
    101
    Answers
    8
    Vote Rating
    3
    sskow200 is on a distinguished road

      0  

    Default


    I thought you had solved that with:

    Code:
    - set Ext.Loader.isFileLoaded.[viewclassname] to false
    However, I do believe if the class definition exists Ext.Loader won't kick in. This is most likely because using the Ext.Loader in a production application is not advised by the Ext designers. Could you give my an example on what you mean by

    "I want to have the possibility to let users here modify class definition"

    It seems like if this is just user configurable options for each class, then another approach may be better, but I don't quite understand your use case.

  7. #7
    Sencha User
    Join Date
    Jan 2012
    Posts
    13
    Vote Rating
    0
    joseph.piron is on a distinguished road

      0  

    Default


    No isLoaded doesn't do the trick neither.
    But it doesn't matter, I fellback on another paragidm: config by item saved. It works

    Thanks!

Thread Participants: 2

Tags for this Thread