[jQuery] jqModal, nestedsortablewidget and Dynamic Ajax URLs: My Solution

[jQuery] jqModal, nestedsortablewidget and Dynamic Ajax URLs: My Solution


I've worked for two days with problems calling jqModal windows with
different ajax URLs. I've read a number of the solutions here and
elsewhere, but two problems were never solved, except by workarounds,
which I thought I'd share in case they can help anyone else:
(1) I was unable to use a class as a trigger failed within the
nestedsortables widget, so I had to use a a javascript call that calls
jqm() on each click instead of at the ready() level. Otherwise, the
triggers are simply ignored. I am guessing it is something in the
nestedsortable widget that causes the problem because the same links
work fine outside its div.
(2) The click function I had to use because of the first issue works
fine to summon the window using the jqm() call, but the changing ajax
URL was not reflected in the contents of the window. That is, the
window kept showing the original URL, no matter how I tried to play
with the onLoad and onShow functions. The closest I got was to using
hash.w.load(global-url-var), but that refreshed the whole underlying
page!
In any event, I made one small change to jqModal that helped me
immensely and may help others. It allows me to use this syntax:
ajax: function() { return my_dynamic_url; }.
Line 49, was u=c.ajax, and I changed it to u=c.ajax(). I know this is
not the ideal fix, but my jquery skills are pretty limited. I am
hoping the author can support this with a more comprehensive solution.
Thanks to the authors for both jqModal and the nestedsortable widget,
which are both really excellent!