Trouble Serializing items()

1 view
Skip to first unread message

Bryan Veloso

unread,
Jan 16, 2009, 9:42:15 PM1/16/09
to chainjs
Hi,

My colleague and I have been having some trouble trying to serialize
data, and since there aren't many docs on actually retrieving data
from chain.js and interaction.js, we're sort of shooing blind. We're
using interaction.js to allow users to drag list items from one list
to another and then serializing the data upon finishing. We've gotten
all the interaction down, but again, the serialization is the problem.
When we try and produce an alert with the data contained in the "data"
array, we get a list of [object Object]. It'll show the correct number
of objects in the div being dragged to, but for the life of us we
can't get the actual data to show.

Here's the code: http://dpaste.com/109966/
Here's a screenshot of the results we're getting from the alert:
http://grabup.revyver.com/27804b937090ba86a53fed11b6ad9b60.png

Any help would be greatly appreciated, we don't have anywhere else to
turn for this functionality.

Sincerely,
Bryan Veloso

Rizqi Ahmad

unread,
Jan 17, 2009, 1:16:55 AM1/17/09
to chainjs
Hi Bryan,

what result do you want to get?

Rizqi Ahmad

unread,
Jan 17, 2009, 3:46:38 AM1/17/09
to chainjs
are you trying to serialize the data to JSON? items('data') serialize
the data to a javascript object. If you want to serialize it to a
string you need a json serializer.

I created a plugin for chain.js to serialize data to json-string:
http://github.com/raid-ox/chain.js/tree/79d69bfbd381f1589d03518854e077ff62bc9984/plugins

Bryan Veloso

unread,
Jan 17, 2009, 6:18:24 AM1/17/09
to chainjs
Thank you Rizqi, I'll try this and get back to you. :)

Cheers,
Bryan

On Jan 17, 12:46 am, Rizqi Ahmad <raid...@yahoo.de> wrote:
> are you trying to serialize the data to JSON? items('data') serialize
> the data to a javascript object. If you want to serialize it to a
> string you need a json serializer.
>
> I created a plugin for chain.js to serialize data to json-string:http://github.com/raid-ox/chain.js/tree/79d69bfbd381f1589d03518854e07...

greg.newman

unread,
Jan 17, 2009, 6:41:14 AM1/17/09
to chainjs
Thanks Rizql!! This worked perfectly for us. Appreciate the quick
response!

On Jan 17, 3:46 am, Rizqi Ahmad <raid...@yahoo.de> wrote:
> are you trying to serialize the data to JSON? items('data') serialize
> the data to a javascript object. If you want to serialize it to a
> string you need a json serializer.
>
> I created a plugin for chain.js to serialize data to json-string:http://github.com/raid-ox/chain.js/tree/79d69bfbd381f1589d03518854e07...
Reply all
Reply to author
Forward
0 new messages