On 21 Apr 2006, at 14:36, Johnny B wrote:
I know what the problem is but don’t know why it is happening. If i
place the sortable table in any view that isn’t called using AJAX it
works. If i put the table code on the view index.rhtml it works
Aha, couldn’t it be because your sorttable.js initializes everything
that much of a JS guru :-))
addEvent(window, “load”, sortables_init);
With this function, your page is searched for tables which need to be
sortable and then the necessary events are attached, ?
When you replace certain parts of your page using AJAX, the onload
event doesn’t fire anymore, so the new table isn’t getting the
necessary events added to be sortable.
You should be able to call the sortables_init() function again after
each AJAX call, so that your table gets the events it needs. Don’t
do this on each call to the page, whether it’s through normal loading
Peter De Berdt