spry:setrow and spry:setrownumber Attribute Sample

This page demonstrates the use of the spry:setrow and spry:setrownumber attributes. Both attributes require a single name of a data set as their value. After a spry:region or spry:detailregion is re-generated Spry will run through the resulting region content and attach a non-destructive click event handler to each element that has a spry:setrow or spry:setrownumber. For spry:setrow, this event handler calls setCurrentRow() with the ds_RowID of the row that was used at the time that particular element was generated. Likewise, for spry:setrownumber, the event handler calls setCurrentRowNumber() with the ds_RowNumber of the row that was used at the time that element was generated.

These attributes were meant to be used as a short cut, so instead of setting the current row on a click manually like this:

<ul spry:region="dsEmps" spry:repeatchildren="dsEmps">
<li onclick="dsEmps.setCurrentRow('{ds_RowID}');">{name}</li>
</ul>

you can now do this:

<ul spry:region="dsEmps" spry:repeatchildren="dsEmps">
<li spry:setrow="dsEmps" >{name}</li>
</ul>


This sample uses the spry:setrow attribute. Click on the name of a product, and the detail region will update.

  • {name}
{desc}

 


This sample uses the spry:setrownumber attribute. Click on the name of a product, and the detail region will update.

  • {name}
{desc}