trouble binding custom events
Hi,
I have a jqueryui dialog box which opens, and has a treeview control inside it. this control is rich with ajax calls, and thus makes use of live events on selectors.
However I noticed, if I close the dialog and reopen it, events start duplicating, and triplicating if closed/opened a third time.
So I decided I need to dispose of the live events when the dialog box is closed. In my dialog close function, I put the following:
- $("body").toggle("destroytreeview");
and in my treeview initialising I bind to that:
- $("body").bind("destroytreeview", function() {alert("destroying treeview");});
But nothing happens, the toggle is triggered, but its not caught.
What am I doing wrong?