Closed squalvj closed 6 years ago
the issue has been fix, i simply add 'data' object in ajax
$('#pagination-container').pagination({ dataSource: 'https://localhost/rizraz/api.php', locator: 'name', totalNumber: <?php echo $num_rows?>, pageSize: 8, alias: { pageSize: 'limit', pageNumber: 'current' }, ajax: { data : { monyet: 100 }, beforeSend: function() { dataContainer.html('Loading data from flickr.com ...'); } }, callback: function(data, pagination) { // template method of yourself var html = template(data); dataContainer.html(html); } })
much thanks bro
Yes, you can also add another param to path like that and that will be concatenated (but your variant is better):
container.pagination({
dataSource: 'http://mytube.loc/api/posts?withCount',
totalNumber: 25,
locator: 'posts',
totalNumberLocator: (response) => {
return response.count
},
pageSize: 5,
className: 'paginationjs-theme-blue',
ajax: {
beforeSend: (pagination, d, c) => {
$("html, body").animate({ scrollTop: 0 }, 600)
}
},
callback: (response, pagination) => {
this.currentPage = pagination.pageNumber
this.posts = response
}
})
@squalvj this is only working for non dynamic data if you passed like Math.random() it will not change. Any ideas ?
@superRaytin hi, has @dkarandana question been solved? Thanks!
@dkarandana @diego06884 you can solve it by passing ajax
as a function now :) , pls upgrade to 2.1.3
@superRaytin super cool !
hi, i'd like to know how i add extra parameter in example, i want to add parameter like type='test' so in url become : /test.json?pageNumber=2&pageSize=10&type=test
thankyou mate, your plugin is awesome