-
Notifications
You must be signed in to change notification settings - Fork 310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DOM not updating when model changes on onclick #726
Comments
So this is bizzare. As I retrieved from the server additional news, I was doing the following: model.news = news;
newsBinds.unbind();
newsBinds.bind(); where model is the model i get in the onclick function code. I consoled-out the new model and it is updated correctly although the HTML did not update at all. But if i do this: model.news[0] = news[0];
model.news[1] = news[1];
model.news[2] = news[2];
newsBinds.unbind();
newsBinds.bind(); Then it works. What am I missing? |
I found that if i use the original view (my var newsBinds) i can do newsBinds.models.news = news and that works. it's just not super clear why it wouldn't work in the first case above. |
I haven't used Rivets in a long time, but from memory, Rivets uses getters/setters on each child of the model object to track updates to it. By doing Also, I'm not sure about the |
@mm-ns |
I am using rivets to bind news stories i retrieve from http call to my dom; It's paginated so i load 3 at a time.
in my js i do this:
the model is updated correctly in all various attempts i made but the html never gets updated. any ideas what im doing wrong?
The text was updated successfully, but these errors were encountered: