Ah, no, you aren't sending JSON. The code you used here:
data: {"data": handsontable.getData()}, //returns all cells' data
ended up creating N (where N is some number) of form fields that CF saw as
data[0][]
and so on. CF isn't going to like this. So what you need to do is convert
the data to JSON on the client side first. You have 2 ways of doing this.
In modern browsers, there is a JSON object. So you could do this:
data: {"data": JSON.stringify(handsontable.getData())}
But if you need to support older browsers, you will want to get a JSON
library. Just Google - there are probably millions of em.
On Mon, Nov 26, 2012 at 8:27 AM, Mo Lay <[email protected]> wrote:
>
> Hi Ray,
>
> value="#form.data#"> did not work as i am not posting from a form.
> in firebug my (post tab) i have the following :
>
> Parameters application/x-www-form-urlencoded
>
> data[0][] 175
> data[0][] Project1
> data[1][] 252
> data[1][] Project2
> data[2][] 253
> data[2][] Project 3
> ....
>
>
> So, i need to "deserializeFromJSON" this data from json and update a
> cfquery based on IDs (i.e 175, 252,...).
>
>
> thanks
>
>
>
> >>
> >> $parent.find('button[name=save]').click(function () {
> >>
> >> $.ajax({
> >> return false;
> >> });
> >>
> >
> >your font end code looks ok.
> >
> >
> >
> >
> >Most likely you wanted a variable there. You said, value="data", which
> >means you passed the literal string data. I believe you want:
> >value="#form.data#">
> >
> >>
> >>
> >--
>
> >===========================================================================
> >Raymond Camden, Adobe Developer Evangelist
> >
> >Email : [email protected]
> >Blog : www.raymondcamden.com
> >Twitter: cfjedimaster
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive:
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:6013
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-newbie/unsubscribe.cfm