How can I access the item views from a collection? Basically I have a table (my collection view) which has rows (as the itemViewClasses). I want to add a particular property to the row I click on and remove that property from all other rows of the table. I want a way to refer to my item views from the collection view so that I can keep a track of which row has that property and add or remove the property (more like set and reset the property) (like a radio button)
Share
You can add a boolean property “isSelected”(Initially set to false) to each of the element during the initialization.
Whenever you click on any of the element set the “isSelected” property of all the elements to “false”.
Then set the “isSelected” property of current “content”(in the itemViewClass) to true.
Now, in the handlebars use {{bindAttr class=”isSelected:active”}} to apply corresponding CSS to your table row. Hope this helps !