Right now I'm using the org.json JSON library.
JSONArray data = new JSONArray();
for (PkgLoad pkgLoad : list) {
JSONArray row = new JSONArray();
row.put(Double.parseDouble(df.format(pkgLoad.ounces)));
row.put(pkgLoad.revolutions);
data.put(row);
}
jsonResponse.put("aaData", data);
This is how I'm building my array. Row by row(I like doing this.) If there is a way to build the data row by row in any other libraries let me know.
Anyway. With that method I get this.
"aaData":[[2.55,6],[2.54,6],[2.53,6],[2.54,6],[2.55,6],[2.52,6],[2.55,6],[2.52,6],[2.54,6],[2.53,6]]}
That's fine. The field names are left off. With the other libraries I get the field names. So it becomes this.
"aaData":[["ounces" : 2.55, "revolutions" : 6], etc, etc}
How do I omit this fields. Thank you very much.