I was writing a test script for returning some user-data to a UI client. The client expected a return in two formats in different places: 1. A jqGrid to display a datagrid of users and 2. for a config object that expected data in name value pairs.
Using cfml as the middle tier makes life so easy. I banged out a simple cfml script.
When calling this script just pass in the url parameter value for the variable “optimized” (Line 3 above).
Passing in a value of true will yield (array of arrays in “rows”):
…while a value of false will yield (array of objects in “rows”):
Hope it will help someone (or me in the future…I tend to forget :) )