-
Notifications
You must be signed in to change notification settings - Fork 305
Open
Description
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.
<section class="news-section">
<div class="col-12 post" rv-each-new="news">
<h5 class="h4capslight mb-3">{new.date}
<a href="" class="h4capslink">NEWS</a>
</h5>
<a href="#newsroom-post">
<h1 class="mb-3">{new.title}</h1>
</a>
<a href="#newsroom-post">
<p class="post-desc mb-4">{new.content}</p>
</a>
<a class="link-underline" href="#newsroom-post">Read More</a>
</div>
<div class="col-12 mt-5">
<nav aria-label="navigation">
<ul class="pagination">
<li class="page-item" rv-each-page="numberOfPages" rv-on-click="loadPage">
<a class="page-link" href="javascript:void(0)" value="index">{ index | mathadd 1 }</a>
</li>
</ul>
</nav>
</div>
</section>in my js i do this:
$.ajax({
url: "api/items?",
type: 'get',
headers: {
....
},
data: {
....
},
success: function (r) {
news = r.xyz;
newsBinds = rivets.bind($('.news-section'), {
news: news,
page: page,
loadPage: function(e,model){
//here I tried to do another call to fetch more data or do a recursive call to this function.
then when i get the new data i do --> newsBinds.news = news;
}
})
},error:function(xhr){
}the model is updated correctly in all various attempts i made but the html never gets updated. any ideas what im doing wrong?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels