uncopenweb / torongo

Utilities for using Mongo with Tornado.
6 stars 1 forks source link

Sorting not working #2

Closed parente closed 14 years ago

parente commented 14 years ago

ms= blank on request URL. Here's what I'm doing in JS:

var req = this.model.fetch({ query: {label : ''+this.query+''}, onBegin: this._onBegin, onItem: this._onItem, onComplete: this._onComplete, onError: this._onError, start: this._page * this.rowSize, // fetch one extra to check if there's a next count: this.rowSize + 1, /queryOptions: { deep: false, ignoreCase: true },/ sort : { attribute : 'label', descending : true }, scope: this });

gbishop commented 14 years ago

Your sort arg should be an array. sort: [ { attribute: 'label', descending: true } ]

parente commented 14 years ago

OK. The dojo stores must have up converted for me. Would be nice if Torongo did that to if only a single object is passed.

gbishop commented 14 years ago

I don't see any support in dojo.data.util.sorter.js for up converting the arg. I can't see how it can work without an array argument. Can you?

parente commented 14 years ago

Maybe I was getting lucky and it was defaulting to some order in itemfilereadstore. I tested with about 15 items in my local store at one point and they were sorted in some alphabetical way.

parente commented 14 years ago

Working.