jQuery optionTree plugin preselect option
I'm using the jQuery plug in named optionTree:
http://code.google.com/p/jquery-option-tree/ to handle Google Base Taxonomy structure.
I am loading each level dynamically from the taxonomy file and have been having an issue with pre-loading the optionTree. Here is a demo: http://www.partreports.com/upload/treetest.php
I am storing the value (text) the user selected in a database and I need to preload the "tree" with the stored value when the user returns to the page.
If I selected 'Arts & Entertainment > Crafts & Hobbies > Leather Crafts' I want the first level select to be preloaded with 'Arts & Entertainment', the second level select to be preloaded with 'Crafts & Hobbies' and the third level select preloaded with 'Leather Crafts'.
The current preload only works when you fully load the tree.
I can preload the first items by using the preselect option like this:
- preselect: {"demo5":"Arts & Entertainment"}
But how would I preselect the others when they are dynamically loaded?
If I do this:
- preselect: {"demo5":"Leather Crafts"}
'Leather & Crafts' IS preselected but only when the third level select is created after selecting 'Crafts & Hobbies' in the second level select.
If at all possible, I'd also like to know how to remove a select when the 'Choose level X' is selected.