On Wednesday 14 June 2006 13:34, Thomas Hervé wrote: > luciano a écrit : > > Hi all! > > Im trying to use Mochikit.Sortable but i want to trigger my actions > > when i finally drop the element, because if i use onchange, the > > function is called each time the element is surfing betwen the other > > sortable elements. > > > > AFAICsee there is a ondrop function in a dropp'able element, so im > > wondering if it is possible to Mochikit.Sortable.Sortable.create to set > > this ondrop function as an option. > > This is not exactly (I think) what you want. You should look at the > 'onUpdate' option of create, it's called every time the serialization > of the Sortable change. To customize the serialization, use the format > option (it's a regexp checking id of items).
Ok, ussing onUpdate and format:/(regexp)/ it works as expected, and now i'm ussing serialize with success. Take me a while to figure out that i need to generate an explicit match (ussing '()') to make serialize work, but no complains about no docs, couse im ussing svn code here :-). > > Aditionally im ussing <div>s instead off <li>s, and affter sorting, i > > was not aviable to find the new order trougth childNodes nor > > nodeWalk(), both returns me the <div>s in the original order, but > > visually sort works ok. > > Strange... I see no reason why it should not work with childNodes. If > you can make a simple example reproducing the problem it would be > great. Ok, simple example attached, error reproduced on firefox 1.5 with firebug extenstion. Maybe it is because my use of javascript, maybe not, im relative new to javascript. -- Luciano http://www.praga.org.ar/ --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "MochiKit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/mochikit -~----------~----~----~----~------~----~------~--~---
i'm the first div
i'm the second div
i'm the third div
