Hi,

I would like to display a formatted price using
{function::<function_name>} data reference in paged view, but
I keep getting the “processTokens: Failed to get a data set
context!” error message and don’t know what I’m doing wrong.

Here is the sample:

var ItemDataSet = new Spry.Data.DataSet();

ItemDataSet.setColumnType(‘price’, ‘number’);

var ItemPagedView = new Spry.Data.PagedView(ItemDataSet, {
pageSize: 30 });

ItemPagedView.setColumnType(‘price’, ‘number’);

function formatPrice(region, lookupFunction)

{

// just returning the value to see if it’s working…. but
not working.

return lookupFunction(‘price’);

}

<div spry:region=”ItemPagedView ItemDataSet”>

<table>

<tr>

<td spry:sort=”itemName”>Product Name</td>

<td spry:sort=”price”>Price</td>

</tr>

<tr spry:repeat=”ItemPagedView”>

<td>{itemName}</td>

<td>{function::formatPrice}</td>

</tr>

</table>

</div>

Please help

|||
Hi,

Wrap your data refs in {}:

return lookupFunction(‘{price}’);

and ensure that you have Spry 1.6.1.

Related posts:

  1. PagedView/DataSet sorting problem
  2. how to select an item in the column and row in Data set
  3. Tweaking a sort
  4. How to reload then sort xml data
  5. spry:sort on nested data set

Related posts brought to you by Yet Another Related Posts Plugin.

 Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

   
© 2012 free icons download Suffusion theme by Sayontan Sinha

Featuring Recent Posts WordPress Widget development by YD