cloudflarearchive / backgrid

Finally, an easily stylable semantic HTML data grid widget with a Javascript API that doesn't suck.
http://backgridjs.com
MIT License
2.01k stars 325 forks source link

Retaining class tags on <tr> after update #134

Closed ddevault closed 11 years ago

ddevault commented 11 years ago

Hi there, I have some code using backgrid to make a pretty grid, and when a row is clicked, I give it the "selected" class:

Backbone.on("rowclicked", function (row) {
    $("tr.selected").removeClass("selected");
    $(row.$el).addClass("selected");
});

However, when I run collection.fetch();, I lose the "selected" class. Is there a good way to keep this in place?

wyuenho commented 11 years ago

http://backgridjs.com/#api-row

http://backbonejs.org/#View-delegateEvents

wyuenho commented 11 years ago

Hi, do you still have trouble with this issue?

ddevault commented 11 years ago

No.