Mizzao\autocomplete Sort


#1

Hi there,
Is there any way that my Mizzao\Autocomplete input could be sort in specific way? Mizzao let me to sort the data, but I think it is sorting by name and only thing I can do is “sort:true” or “sort:false”.
I need to get 5 last modified inputs.

Now it looks like this:

Template.single.helpers({

    settings: function() {
    return {
      position: Session.get("position"),
      limit: 5,
      rules: [
        {
          // token: '',
          sort:true,
          collection: InvoicesItem,
          field: 'description',
          matchAll: false,
          template: Template.standardLegends,
        }
      ]
    };
  },

May I do something like: “sort:{createdAt:-1}” ? I’ve tried to find the answer, but I think nobody ask for that.


#2

Hello, anybody there? :smiley:


#3

I was also looking for a way to provide an object for sorting, but looks like current implementation sorts by the field attribute in ascending order