- Create Account

CheckTree and Ajax - can it be done?

Forums > "Miscellaneous" Scripts > CheckTree and Ajax - can it be done?
Author
Message

1) RichardForster Group: Members
Posts: 2 Joined: 3 Jan 2008 Location: Australia IP: 136.186.--.--
Hi all,

CheckTree works simply and as advertised with a static unordered list. However if the list is changed there doesn't seem to be a way of pointing CheckTree at it and saying 'do it again'. You can ask to have a new CheckTree based on the same list, but some of the critical initialization code is not executed. Anybody managed to find a work around?

Richard Forster

2) RichardForster Group: Members
Posts: 2 Joined: 3 Jan 2008 Location: Australia IP: 136.186.--.--
Er,

think I can answer my own question. Add the following as the last line in function CheckTree(myName) :

CheckTree.list[myName].init()  

Haven't tried this in the situation of multiple trees, and maybe there should be some other code adjusted, but seems to work for me.
Richard Forster

3) Angus Turnbull Group: Moderators
Posts: 4042 Joined: 7 Dec 2003 Location: New Zealand IP: 203.109.--.--
Sounds good! Yeah, the way the script is currently coded you have to re-initialise it when you modify the DOM, if I were to write it again in this post-AJAX world I'd make it just inspect the list on the fly :).

-  Angus.

Post a Reply:

You are not logged in, and will be posting anonymously as a guest. If you want to post using an account, please login at the top of this page.