Hi,

I’m having a problem sorting number column using PagedView.

Here is the JavaScript (partial):

var dataset = new Spry.Data.XMLDataSet(null, ‘/Items/Item’);

dataset.setColumnType(‘price’, ‘number’); // dataset is
loaded with items using Ajax request later on…

var view = new Spry.Data.PagedView(dataset);

Here is the HTML (partial):

<div spry:region=”view dataset”>

<table>

<tr>

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

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

</tr>

<tr spry:repeat=”view”>

<td>{itemName}</td>

<td>{price}</td>

</tr>

</table>

</div>

When I click on “price” column, it is sorted as “string”
instead of “number”. I would like to sort it as number. The column
type for “price” is set to number. Is there a workaround for this?

|||
I think you need to set the column type on the paged dataset.

view.setColumnType(‘price’,'number’);|||
Oops, thanks for letting me know. Didn’t notice that the
PagedView had a method to set its column type….

Related posts:

  1. PagedView state problem
  2. How to add additional data to an existing dataset
  3. Can you specify spry:region to call a dataset dynamically?
  4. Selected row on a spry table
  5. Column widths in Spry dataset display

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