1. #1
    Sencha User
    Join Date
    Apr 2008
    Posts
    51
    Answers
    3
    Vote Rating
    0
    Michou is on a distinguished road

      0  

    Default Answered: [PR4]->[B1] dom element remove

    Answered: [PR4]->[B1] dom element remove


    Hi,

    In my html file :
    Code:
    <body><div id="loading-mask"></div></body>
    and in my app.js [PR4] :
    Code:
        launch: function() {
            Ext.create('myApp.view.Main');
            var loadmask = Ext.get('loading-mask');
            loadmask.remove();
        }
    in [B1], I use :
    Code:
        launch: function() {
            Ext.create('mtApp.view.Main');
            var loadmask = Ext.get('loading-mask');
            Ext.removeNode(loadmask);
        }
    but it's not working. Some ideas ?

    thx

  2. I noticed that as well, so I use the "destroy" method

    Code:
    loadMask.destroy();
    instead of "remove" and that works fine. For me, "destroy" works out better since I want to actually remove the component from the DOM, not just hide it.

  3. #2
    Sencha User
    Join Date
    Apr 2008
    Posts
    51
    Answers
    3
    Vote Rating
    0
    Michou is on a distinguished road

      0  

    Default


    when using :
    Code:
    loadmask.hide();
    it works

  4. #3
    Sencha User
    Join Date
    Dec 2011
    Posts
    56
    Answers
    4
    Vote Rating
    0
    clarose is on a distinguished road

      0  

    Default


    I noticed that as well, so I use the "destroy" method

    Code:
    loadMask.destroy();
    instead of "remove" and that works fine. For me, "destroy" works out better since I want to actually remove the component from the DOM, not just hide it.

  5. #4
    Sencha User
    Join Date
    Apr 2008
    Posts
    51
    Answers
    3
    Vote Rating
    0
    Michou is on a distinguished road

      0  

    Default


    yes I was testing the "destroy" method
    thx

  6. #5
    Sencha - Sencha Touch Dev Team rdougan's Avatar
    Join Date
    Oct 2008
    Posts
    1,158
    Answers
    93
    Vote Rating
    6
    rdougan will become famous soon enough

      0  

    Default


    Yup, remove has been deprecated in beta 1. If you use the compat build you will see the deprecation warnings when you use it. More information about the compat build here:

    http://docs.sencha.com/touch/2-0/#!/guide/building
    Sencha Inc.
    Robert Dougan - @rdougan
    Sencha Touch 2 and Ext JS 4 Core Team Member, SASS/Theming Wizard.

Thread Participants: 2