Skip to content

Instantly share code, notes, and snippets.

@akinsgre
Created August 19, 2011 14:49
Show Gist options
  • Save akinsgre/1156970 to your computer and use it in GitHub Desktop.
Save akinsgre/1156970 to your computer and use it in GitHub Desktop.
Java object for DynaTree
public class Thing {
private String title ;
private List<Thing> children ;
public Thing(String title) { this.title = thing );
// getters and settors accordingly
}
List<Thing> things = new ArrayList<Thing>() ;
things.add(new Thing("One"));
/*
based on that, I think that toJSONObject(things) will result in
[{title:"One"}]
and adding additional Things with children will cause the additional objects to fall in the correct structure
This, of course, ignores that Dynatree can have attributes like "key" and "isFolder".. that that is pretty self explanatory
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment