Opened 8 years ago
Closed 5 years ago
#17227 closed enhancement (patchwelcome)
JsonRest add sortOptions member
Reported by: | Herman Vierendeels | Owned by: | Kris Zyp |
---|---|---|---|
Priority: | undecided | Milestone: | 1.11 |
Component: | Data | Version: | 1.9.0 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description
Would it be possible to add sortOptions: to JsonRest?.
e.g. for store-queries that should always have sort-parameter
//sortOptions: Array e.g // [{attribute:"tmstmp",descending:true}] query: function(query, options){ options = options || {}; .... if(! options.sort){ if(this.sortOptions){ options.sort=this.sortOptions; } } if(options && options.sort){ .... }
by the way, why is there if(options && options.sort)
options is ensured to exist by initial statement:
options = options || {};
Or am i totally wrong?
Change History (4)
comment:1 Changed 8 years ago by
Component: | General → Data |
---|---|
Owner: | set to Kris Zyp |
comment:2 Changed 8 years ago by
comment:3 Changed 8 years ago by
yes indeed this could be done by subclassing.
but i think that , being able to set sortOptions for all queries, is a rather general requirement.
comment:4 Changed 5 years ago by
Milestone: | tbd → 1.11 |
---|---|
Resolution: | → patchwelcome |
Status: | new → closed |
Will consider for dstore ( http://dstorejs.io/ ). A pull request is welcome for dojo/store.
Note: See
TracTickets for help on using
tickets.
this sounds like something you could do with a subclass of JsonRest?
given that, maybe it's not right to put it into JsonRest? itself?