Backbone.ModelBinder icon indicating copy to clipboard operation
Backbone.ModelBinder copied to clipboard

why is auto_sort not by default on for collectionbinder?

Open lastquestion opened this issue 11 years ago • 8 comments

It seems like it should be on by default. any reason why it's off? If I have a sorted collection and I add an item and the objects are reshuffled, I feel like collectionbinder should listen on that and reorder the child views. In a majority of use cases we'll have things like rows in a table, etc. which should be reordered if ordering is important.

This would also follow the default case of "doing the right thing with basic behavior". I can see corner cases for doing nice things like animated transitions, etc. that the user would have to write code for, but that's a corner case that can be enabled by turning off auto_sort for that case.

lastquestion avatar May 02 '13 07:05 lastquestion

I agree. If you'd like, add it to the options, please test it out and do a pull request.

theironcook avatar May 02 '13 13:05 theironcook

Makes sense to me. We've just wrapped all our calls to CollectionBinder and turned it on by default.

katowulf avatar May 02 '13 15:05 katowulf

Yes, I'll pull request later tonight. Thanks!

lastquestion avatar May 02 '13 15:05 lastquestion

Sorry, what's the build process to regen min.js? Not seeing anything...

lastquestion avatar May 02 '13 23:05 lastquestion

Currently using http://jscompress.com/ for minification. Remember to preserve the comments at the top of the minified version and update the release version in both.

katowulf avatar May 02 '13 23:05 katowulf

Sorry it took so long. Take a look, should be good.

lastquestion avatar May 06 '13 10:05 lastquestion

I'm going to rewrite as per feedback, but it will take a couple days. Will repull request when I'm ready. PS I saw the travis build failed in the pull request, how do I run that locally?

lastquestion avatar May 09 '13 19:05 lastquestion

@lastquestion

Don't worry about the travis build. I was having trouble getting PhantomJS hooked up and gave up.

theironcook avatar May 10 '13 14:05 theironcook