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> </code>

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.

Raymond Camden's Picture

About Raymond Camden

Raymond is a developer advocate for Extend by Auth0. He focuses on serverless and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support.

Lafayette, LA https://www.raymondcamden.com

Comments