ColdBox Forums Notification: Post to How can I return json ajax data without a view?

Title: RE: How can I return json ajax data without a view?
Thread: How can I return json ajax data without a view?
Forum: Need Help?
Conference: ColdBox
User: sanaullah73 Hi

Use ColdBoxProxy.cfc
[code]

<cffunction name="getJsonRegions"
output="false" access="remote" returnFormat="any" hint="Process a remote call
and return data/objects back.">
    <cfset var qryRegions = "">
    <cfset
getController().setSetting("DebugMode",false) />
    <cfset arguments["event"]=
"ehGeneral.qryGetRegions">
    <cfset qryRegions =
super.process(argumentCollection=arguments)>
    <cfset qryRegions =
getController().getPlugin("toJSON",true,false).queryToJSON(qryRegions,"qryRegion
s") />
    
    <cfreturn qryRegions>
  </cffunction>
[/code]

In your
eventhandler nolayout return the qryDATA back to proxy. then convert to JSON.
There are many ways to do this... its your choice how you would like to
implement.

ColdBox code-depot have 2 plugis, toJSON, toXML download them
Thanks
Sana
http://www.luismajano.com/forums/index.cfm?event=ehMessages.dspMessages&threadid=3C2B7624-FF65-CEF6-65305634284A222E