Skip to content

Instantly share code, notes, and snippets.

@sdesai
Created September 12, 2011 19:49
Show Gist options
  • Save sdesai/1212192 to your computer and use it in GitHub Desktop.
Save sdesai/1212192 to your computer and use it in GitHub Desktop.
var tree = new Y.ParentWidget({
id: "tree"
});
// tree.plug(Y.SM.Plugin.WidgetParentRenderQueue, {timeout:2000});
tree.render();
tree.add({ type: Y.ChildWidget, id: "leaf-2", label: "Leaf Two" }, 1);
tree.add({ type: Y.ChildWidget, id: "leaf-1", label: "Leaf One" }, 0);
tree.add({ type: Y.ChildWidget, id: "leaf-3", label: "Leaf Three" }, 2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment