[dgrid] add secondary sort-property

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[dgrid] add secondary sort-property

Gerhard Presser-2

hi all,
in dgrid 0.3.x I used _getQueryOptions to add another - in fact primary - sorting property prior to actually query the store.
I need this, because I want to have some sort of grouping.
The user can just select one single sort criteria, and the rendering (in the header etc.) is just fine.

We recently switched to the latest dgrid+dstore - I'm having a hard time figuring out, how to build a similar system. It seems to me, that _StoreMixin.setCollection() may be a good starting-point. but the sort-array is given to the collection "as-is".

Is there any feature I'm missing?
regards

-- 
Gerhard Presser

Groiss Informatics GmbH
Strutzmannstra├če 10
A-9020 Klagenfurt
AUSTRIA

Work: +43 463 504694-17
Fax: +43 463 504694-10
Web: www.groiss.com

FN 168125v LG Klagenfurt | UID ATU44898401 

--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [dgrid] add secondary sort-property

Simon Walter
On 06/09/2016 11:02 PM, Gerhard Presser wrote:

> hi all,
> in dgrid 0.3.x I used _getQueryOptions to add another - in fact primary
> - sorting property prior to actually query the store.
> I need this, because I want to have some sort of grouping.
> The user can just select one single sort criteria, and the rendering (in
> the header etc.) is just fine.
>
> We recently switched to the latest dgrid+dstore - I'm having a hard time
> figuring out, how to build a similar system. It seems to me, that
> _StoreMixin.setCollection() may be a good starting-point. but the
> sort-array is given to the collection "as-is".
>
> Is there any feature I'm missing?
> regards
>

I am not sure how to use it, but I think there is a feature that will do
what you need. From the Collection documentation:
"
#### `sort([highestSortOrder, nextSortOrder...])`

This also sorts the collection, but can be called to define multiple
sort orders by priority. Each argument is an object with a `property`
property and an optional `descending` property (defaults to ascending,
if not set), to define the order. For example:
`collection.sort([{property:'lastName'}, {property: 'firstName'}])`
would result in a new collection sorted by lastName, with firstName used
to sort identical lastName values.
"

Simon
--
Dojo Toolkit: http://dojotoolkit.org/
Tutorials: http://dojotoolkit.org/documentation/

[hidden email]
To unsubscribe, visit: http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
Loading...