On Apr 6, 4:12 pm, HotShot <hs...@gmx.net> wrote:
> Hi,
>
> i created some sortable lists. Now I'm getting the error "element is
> null" in line 599 of the original dragdrop.js when a item from one
> list ist dropped into another. When I release the mouse button nothing
> happens. When I click it again the item droppes where it should drop.
>
> The code around line 599 would be:
>
> var Sortable = {
>   SERIALIZE_RULE: /^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/,
>
>   sortables: { },
>
>   _findRootElement: function(element) {
>     while (element.tagName.toUpperCase() != "BODY") {
>       if(element.id && Sortable.sortables[element.id]) return element;
>       element = element.parentNode;
>     }
>   },
>
>   options: function(element) {
>     element = Sortable._findRootElement($(element));
>     if(!element) return;
>     return Sortable.sortables[element.id];
>   },
>
> ...........
>
> Where as line 599 would be while (element.tagName.toUpperCase() !=
> "BODY") {
>
> Does anybody have an idea why this could be?
> Could it be, because the html tags for the sortalble divs are
> generated dynamically by  javascript?

This kind of error means that you are passing an element into one of
the Scriptaculous functions as null. This might be a simple error in
your programming but it is often because you are passing an element
which does not yet exist (perhaps because you have done some innerHTML
and not given the DOM time to operate.

Without more of your code, it's impossible to tell: but please don't
post a large amount: look at where the element values come from that
you are passing into Dragdrop functions.

-- 
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptacul...@googlegroups.com.
To unsubscribe from this group, send email to 
prototype-scriptaculous+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en.

Reply via email to