Cool Spry Tip

This post is more than 2 years old.

I missed this from two versions ago or so, but Spry has a new attribute to make master/detail work a bit easier. In the past, you would typically use code like this to display a set of data and allow a user to click to load a detail region:

<tr spry:repeat="mydata" onclick="mydata.setCurrentRow('{ds_RowID}');">

Notice the onclick? This tells Spry to update the current selected row. This is now done like so:

<tr spry:repeat="mydata" spry:setrow="mydata">

Love it. One more line of JavaScript removed.

Raymond Camden's Picture

About Raymond Camden

Raymond is a developer advocate for HERE Technologies. He focuses on JavaScript, serverless and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA