RVEX - News: Release .93 improves the JSON output. While the initial subroutine (type101) produced properly-formatted JSON, the column va
Release .93 improves the JSON output. While the initial subroutine (type101) produced properly-formatted JSON, the column values for each document in the view were presented as a JSON array instead of a simple JSON object with name/value pairs. This made the JavaScript dot notation to reach the value clumsy. I added subroutine "type102" to correct this feature, while retaining type101 as an example.
The JavaScript for the Handler() function in the sample page has been upgraded to use typ102 and will be posted as a screenshot shortly.
Essentially, once the eval has occurred on the JSON data, the column value for each document is referenced with:
viewentries[i].doc.columnname
e.g.
viewentries[i].doc.city
viewentries[i].doc.state
(where i is the counter integer for the loop from 0 to viewentries.length-1)
By way of comparison, type101 that used arrays for each name/value pair required a more clumsy notation:
viewentries[i].doc[0].city
viewentries[i].doc[1].state
Sorry for such a quick new release, but when I noticed this, I thought people who were interested in JSON would want an improved version immediately.