HeathT
20 Jul 2007, 11:06 AM
Hey all
I'm an ext newbie here. I've searched the forums and the web but I can't find the answer to my question, so here goes.
How in the world do I reference data in a JSON structure that is sent back to a Cold Fusion template. I'm assuming its a scope but I've tried various scopes to include but not limited to: variables, form, the formfields array, the structure's 'root', I even attempted a "result(s)" scope as I saw php code using that scope and thought CF might have some hidden scope I had never seen. I got nothing.
Basically I want to send the JSON struct to a Cold Fusion template and perform an update and/or an insert from a grid. So, I'm not concerned about how to walk through the data in the structure as I'm certain once I know how to reference them I can handle that.
I'm using YUI + Ext + Cold Fusion. Below is a simplified version of what I'm trying to do.
My structure being sent to Cold Fusion:
[{"description":"A game of tennis","activity":"Tennis"}]
My Cold Fusion code to use the data for an insert:
<cfquery datasource="myDS" name="addActivity">
INSERT into activities
(activity, description)
values
('#<WHAT SCOPE GOES HERE IF ANY>.activity#', '#<WHAT SCOPE GOES HERE IF ANY>.description#');
</cfquery>
I'm an ext newbie here. I've searched the forums and the web but I can't find the answer to my question, so here goes.
How in the world do I reference data in a JSON structure that is sent back to a Cold Fusion template. I'm assuming its a scope but I've tried various scopes to include but not limited to: variables, form, the formfields array, the structure's 'root', I even attempted a "result(s)" scope as I saw php code using that scope and thought CF might have some hidden scope I had never seen. I got nothing.
Basically I want to send the JSON struct to a Cold Fusion template and perform an update and/or an insert from a grid. So, I'm not concerned about how to walk through the data in the structure as I'm certain once I know how to reference them I can handle that.
I'm using YUI + Ext + Cold Fusion. Below is a simplified version of what I'm trying to do.
My structure being sent to Cold Fusion:
[{"description":"A game of tennis","activity":"Tennis"}]
My Cold Fusion code to use the data for an insert:
<cfquery datasource="myDS" name="addActivity">
INSERT into activities
(activity, description)
values
('#<WHAT SCOPE GOES HERE IF ANY>.activity#', '#<WHAT SCOPE GOES HERE IF ANY>.description#');
</cfquery>