javascript - Dojo: how to delete/destroy a node from NodeList for real -


Here I have a list of nodes and an identification node that wants to remove from the list (both in visual and memory )).

  var currentRow = dojo.query (this) .parents ("div"). First () [0]; Var ParentDive = Dojo.Kuri (present day). Parentes ("Divi"). First () [0]; Var rowList = dojo.query (parentDiv). children ();   

The problem is,

  dojo.destroy (currentRow); Remove   

from viewing only currentRow , but when I can do the rowList loop, firebug I still remove the original size of any original size without seeing the shape of the line, so it starts to remain in memory, so how can we remove a node from the node list and return the node list?

Deleting a node does not manipulate the rowList array, it The DOM only removes the node from the tree, which means that you have the rowList array in the currentRow node cached (and currentRow < / Code> in the variable). DOM nodes are javascript objects, when you delete them from the DOM tree, they become garbage collected by Javascript virtual machines, if they are not accessible.

Div ") after calling (or again) First () [0]; Var ParentDive = Dojo.Kuri (Current Rally) .Parents ("Divi"). First () [0]; Dojo.destroy (currentRow); CurrentRow = null; Var rowList = dojo.query (parentDiv). children ();

If currentRow is accessible globally, set it to null .

See it in action:

Read more in Adi Osmani.

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

jsp - Google line chart x-axis shrinks on transition -

java - Reaching JTextField in a DocumentListener -