Skip to content
This repository has been archived by the owner on Apr 2, 2019. It is now read-only.

Initial collection fetch causes table rows to double render #658

Open
geralddzx opened this issue Nov 12, 2016 · 1 comment
Open

Initial collection fetch causes table rows to double render #658

geralddzx opened this issue Nov 12, 2016 · 1 comment

Comments

@geralddzx
Copy link

When you initially fetch a collection, the collection will trigger add events on each model and trigger a sort event on the collection. Each add event will cause a new backgrid row to be rendered and inserted. The sort event will cause the entire body to refresh will will rebuild and render each row. I have only been able to get around this by fetching all my collections with reset true, which will not trigger add events on each fetched model. It feels like backgrid should have some way of handling this.

@AbhishekPatil9844
Copy link

AbhishekPatil9844 commented Dec 29, 2016

Make sure instead of append you are using html to element. Example this.$('#tableList').html(grid.render().el);

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants