rotundasoftware / backbone.collectionView

Easily render backbone.js collections. In addition to managing model views, this class supports automatic selection of models in response to clicks, reordering models via drag and drop, and more.
http://rotundasoftware.github.io/backbone.collectionView/
Other
171 stars 27 forks source link

Created tests for and fixed bug in get/setSelectedModels by offset for table view #2

Closed colinwren closed 11 years ago

colinwren commented 11 years ago

Changing selection with arrow keys in the table view changing wasn't working because of a problem with:

get/setSelectedModel/s({ by: "offset" })

It was using:

this.$el.find( "> [data-item-id]:visible" )

to get the item elements, which worked fine for the ul views, but not for table views. I added a conditional that checks if the view is rendered as a table and if so, uses this selector instead:

this.$el.find( "> tbody > [data-item-id]:visible" );