I'm working to create an autosuggest and am having problems getting the data to display correctly for the JQUERY plugin.
I have a table full of customers(customerID,fName,lName)
I need to create a JSON response like this:
[{"id":"856","name":"House"},
{"id":"1035","name":"Desperate Housewives"},
{"id":"1048","name":"Dollhouse"},
{"id":"1113","name":"Full House"}
]
Right now my code in Coldfusion looks like this:
Query - sel_Customers.cfm
<cfset newAjax.setJSONStructKey(key="id", value="#sel_Customers.customerID#")>
<cfset newAjax.setJSONStructKey(key="name", value="#sel_Customers.fName#")>
This results in the response:
[{"returnmessage":"The Ajax operation was successful.","name":"Howard","id":"1","returncode":"0"}]
Which displays only 1 record and not 3. Is there a way in Coldfusion to setup the JSONStructKey like required and pasted above?
Thanks