javascript - Multi Column Sorting Using Ember JS -


my requirement sort array using dynamic property names using emberjs.

what have done single column sorting

ents = @get('acceptedentities')  //get array  @set('sortascending', !@get('sortascending')) sort_data = ents.sortby(property_name) //property name sort order 

and looking id

 ents = @get('acceptedentities')    @set('sortascending', !@get('sortascending'))  sort_data = ents.sortby([property_name1, property_name2]) 

i tried above solution no luck , here computed sort , implemented this

model = @get('acceptedentities') sortproperties = [property_name, 'entity_sf_account_name'] sort_data = ember.computed.sort(model, sortproperties) 

but sorting not going properly, please give me suggestions this.

i tried too

sortproperties = ['one:asc', 'two:desc', 'three:asc']  sort_data = ember.arrayproxy.createwithmixins(ember.sortablemixin, {     content: model,     sortproperties: sortproperties }) 

the above code works fine sorting multiple parameter when want sort order not working properly

thanks

there many ways this, this:

sortproperties = ['one:asc', 'two:desc', 'three:asc']  sort_data = ember.arrayproxy.createwithmixins(ember.sortablemixin, {     content: model,     sortproperties: sortproperties }) 

Comments

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -