JSON/Paging Fix for Spry

Use JSON and PagedViews for Spry? Turns out there is a small bug when you use the pathIsObjectOfArrays property, like in the following example:

<script>
var dsContent = new Spry.Data.JSONDataSet("/index.cfm?event=json.getcontent&dd_nobody=1&dd_class=#class.getID()#",{path:"DATA", pathIsObjectOfArrays: true});
dsContent.setColumnType("DOWNLOADS","number");

var pvContent = new Spry.Data.PagedView(dsContent, { pageSize: 5 });
</script>

The bug is in SpryJSONDataSet.js, line 331 which is:

row.ds_RowID = i;

It should be:

row.ds_RowID = j;

Kin Blas of the Spry team found this and has told me it will be in the next release. This bug didn't break paging, but it broke my Page A of B functionality that was in use on a client site.

Comments

Awesome! You may recall I asked you if you had had any problems with this several months ago but nobody (including the folks on the Labs forums) was able to find a bug with this... with this one letter change my problem is gone and I can switch to using JSON instead of XML. ZOOM! :)
# Posted By Will | 9/6/07 11:32 AM