spajax sorting bug in IE
webavant - December 6, 2006 - 23:04
| Project: | nodeorder |
| Version: | 4.7.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
spajax identifies the sortable elements inside of a container object (a div tag in this case) by an undefined ID ('title' should be 'node-sort-list')
There is still a javascript error, but this at least gets the sorting to work in IE.

#1
Could you please post a patch that fixes the problem? Thanks.
#2
Well.. I haven't 'fixed' the bug entirely yet. I will look at it some more and then post a patch.
#3
I reproduced the problem in IE 7 -- do you know if it does the same thing in IE 6? I've "upgraded" all my machines to IE 7 and can't test it in in IE 6 any more.
#4
The issue is also apparent in IE6 as well as IE7. This patch eliminates the error in both IE and FF.
#5
Hmm... apparently I'm not supposed to set status to 'patch' on account of the CVS review team being overburdened with patches. Also, the previous one used both CR+LF, here is another with just LF.
#6
chx helped me decide that it easier to look at without escape characters... this should be the last patch on this issue
#7
webavant,
thank you for the patch -- i will try it as soon as i get a chance. i was hoping to be able to keep the functionality of dragging the nodes only by their titles -- does this patch maintain that? also, is the quotes within quotes business something that is dictated by Spajax or Scriptaculous (or is it even possible to tell)?
marc
#8
This patch does work in 'display nodes by title' mode, which I am quite fond of. The reason for the quotes within quotes is because it is ultimately being output by the Spajax module's function spajax_draggable_element to a string containing javascript. To address an object by ID in javascript you must use quotes. Perhaps the quotes should be patched into the Spajax module? I consider myself novice at javascript, but I'm somewhat certain that the quotes should always be there and cannot think of a reason why not, but someone please correct me if I'm wrong.
#9
Also, just to further clarify, removing the quotes causes a javascript error in IE. Fine in FF.
#10
So, looking at the Scriptaculous documentation, the handle option to Sortable.create is used to further drill down within the object to specify a class name for the draggable thing. In our case, I want just the title to be draggable. I think what's going on is that spajax_sortable_element() is putting out some either unnecessary or incorrect Javascript (I'm no Javascript whiz, either, by any stretch of the imagination).
I'm going to comment out the whole "if-elseif-else" block in spajax_sortable_element to see if it clears things up.
#11
...well, as expected, commenting out the if-elseif-else block in spajax_sortable_element doesn't hurt things in Firefox. but it doesn't fix things in IE...
#12
Any resolution on this? Before the last patch was applied in this thread the drag and drop did not work in IE. After I applied the patch then it worked in IE BUT didn't work in FF.
Is there an earlier version of this module thatr works in both IE and FF? Does ANYONE have this module working fully in both browsers? If so, how did you do it?
#13