Discussion:
[Dojo-interest] how to sort items on filteringSelect
ALPER KOPUZ
2010-03-12 10:06:17 UTC
Permalink
Hello



I am using dojo.require("dojo.data.util.sorter") , fetchProperties inside
filteringSelect to sort items. But unfortunately, I am not able to sort
them. Could you please observe following code and let me know what I am
doing wrong?

Cheers


this.theRSSCountryId = "widgetCatalog-Container_comboRSSCountry";
var that = this;
new dijit.form.FilteringSelect({
id:that.theRSSCountryId,
store: bStore,
searchAttr:"name",
descending: true,
onKeyDown:this.disableKey,
fetchProperties: {sort:{attribute:"name", descending:true}},
//this is where I am trying to sort
onChange:function(val) {
}
}, this.comboRSSCountry);
bStore.newItem({countryCode:"-1", name: "Hepsi"});
..MS..
2010-03-12 11:22:31 UTC
Permalink
Hi,
I sort items previously, in the the object which with you create your
datastore.
Try with

selectValues.sort(function(a, b) {return a.attributeToSortBy<
b.attributeToSortBy? -1 : a.attributeToSortBy> b.attributeToSortBy? 1 :
0;});

Let me know :)
--
View this message in context: http://n3.nabble.com/how-to-sort-items-on-filteringSelect-tp443703p443779.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
ALPER KOPUZ
2010-03-12 12:55:20 UTC
Permalink
Hello

I was wondering if there is a way to do it by using features of dojo such as
the methods of "dojo.data.util.sorter". If I cannot find a solution, I will
go with your way sara.

Cheers
Post by ..MS..
Hi,
I sort items previously, in the the object which with you create your
datastore.
Try with
selectValues.sort(function(a, b) {return a.attributeToSortBy<
0;});
Let me know :)
--
http://n3.nabble.com/how-to-sort-items-on-filteringSelect-tp443703p443779.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
_______________________________________________
FAQ: http://dojotoolkit.org/support/faq
Book: http://docs.dojocampus.org
http://mail.dojotoolkit.org/mailman/listinfo/dojo-interest
..MS..
2010-03-12 13:01:31 UTC
Permalink
Ok..
I posted something about filetringSelect just yesterday, can you see if you
can help?
http://n3.nabble.com/FilteringSelect-scrolling-tp441849ef33424.html
http://n3.nabble.com/FilteringSelect-scrolling-tp441849ef33424.html
Thanks!
--
View this message in context: http://n3.nabble.com/how-to-sort-items-on-filteringSelect-tp443703p443896.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.
power2dojo
2011-12-06 07:19:09 UTC
Permalink
sort needs to be an array, the correct argument is:

{ sort: [{attribute:"name",descending: true}] }


http://bugs.dojotoolkit.org/ticket/11451
http://bugs.dojotoolkit.org/ticket/11451

--
View this message in context: http://dojo-toolkit.33424.n3.nabble.com/how-to-sort-items-on-filteringSelect-tp443703p3563663.html
Sent from the Dojo Toolkit mailing list archive at Nabble.com.

Loading...