1. #1
    Sencha User
    Join Date
    Feb 2013
    Posts
    1
    Vote Rating
    0
    kcherkashin is on a distinguished road

      0  

    Default Checking for existence, before destroying appLoadingIndicator in the generated code.

    Checking for existence, before destroying appLoadingIndicator in the generated code.


    Hello all,

    I'm using Sencha Cmd v3.0.2.288.

    Line #37 of the app.js of the freshly generated application is removing appLoadingIndicator once the application is laucnhed:
    Code:
     Ext.fly('appLoadingIndicator').destroy();
    I think it would be great to check if the DOM element exists. e.g. before working with it.

    Code:
     
    var appLoadingIndicator = Ext.fly( 'appLoadingIndicator' );   
    if( appLoadingIndicator ) {
        appLoadingIndicator.destroy()
    }
    This change prevents users from getting errors when running the app in another environment, e.g. automated testing.

    I understand that this change is really needed for few specific cases, but it would really nice to have it.

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


    This is application specific. The default app has it as it has the loading indicators but if you remove them then it would be up to you to remove the Ext.fly call.
    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.

Thread Participants: 1

Tags for this Thread