Comparator definition redundancy #89
Comments
You generally don't need to override I'm curious tho, what problem is the default behavior causing you that you need to override the default comparator? |
I'm using a natural sort comparator. I know I should probably rely on server side paging for this type of operation, but right now it's not possible for me. |
Sometime I wish JS had operator overloading :) I didn't anticipate this use case and I just assumed whatever you are sorting on will have a natural order comparable by the language's default comparison operators. Another reason is that in the case the collection is not a pageable collection, a comparator will need to be generated and attached to the collection. Lastly, the reason |
So I think if you are using backgrid and pageable, and need to supply your own comparator, you pretty much have to override it in 2 places. |
Yeah, it is tricky. Thanks for answering. |
When using
Backbone.Pageable
in client mode withBackgrid
, I found that if I wanted to replace the default comparator function, I had to override it at two places. Here and here in Backgrid.This seems odd to me. Is there any reason
setSorting
could not take acomparator
or even amakeComparator
option?The text was updated successfully, but these errors were encountered: