Skip to content

Instantly share code, notes, and snippets.

@nuno
Forked from iskugor/app.js
Created January 10, 2016 15:44
Show Gist options
  • Save nuno/d8d282ce59a01fda911d to your computer and use it in GitHub Desktop.
Save nuno/d8d282ce59a01fda911d to your computer and use it in GitHub Desktop.
Remove all child elements in Titanium
function removeAllChildren(viewObject){
//copy array of child object references because view's "children" property is live collection of child object references
var children = viewObject.children.slice(0);
for (var i = 0; i < children.length; ++i) {
viewObject.remove(children[i]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment