• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 181
  • Last Modified:

redoing a bind

I'm trying to make my own treeview app which will pull data from an ajax request (however currently just copying the html in).

My problem that the event binded at the beginning is not copied to the newly created elements. I cannot figure a way of copying or redoing the bind event to the newly created code.

My code is http://jsfiddle.net/yF72u/ which as you can see works on the first branch, but once expanded does not expand on the newly created branches.

Has anyone got any suggestions on how I can redo the bindings?

Thank you
0
tonelm54
Asked:
tonelm54
1 Solution
 
tonelm54Author Commented:
Actually found the answer:-
            $('li').off('click');
            $('li').click(function (event) {
                liClick(this);
            });

Open in new window

http://jsfiddle.net/k7jxn/3/
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now