table serverside pagination: ajax get data but not display
See original GitHub issue#394 I want have server side pagination in my project. template code is similar to https://bootstrap-vue.js.org/docs/components/table/#complete-example.
here is my js code:
watch: {
currentPage: "getInfo"
},
methods: {
getInfo: function() {
const vm = this;
let params = {
pageNo: this.currentPage,
pageSize: this.perPage,
flag: 0,
po: vm.searchOrderNumber,
styNum: vm.searchStyleNumber
};
axiosGet(api.getList, params).then(function(response) {
// handle success
let arr = response.data.list.map(list => {
let poInfo = JSON.parse(list.poInfo);
return {
po: poInfo.po,
procInstId: list.procInstId,
styNum: poInfo.styNum,
color: poInfo.color || "",
typeNameList: poInfo.typeNameList || ""
};
});
vm.items = arr;
vm.totalRows = response.data.totalNum;
});
}
}
presume I am in page 1, and when I click page 2, the ajax was success, And I get the data of page 2(only page 2). But the data was not show because the data is considered belong to page 1.
I hope to add a prop seems like :serverside = “true”, to just display the items ajax give to itself. It is really no neccessary to pagination local again!
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Search and Pagination not working while using server-side
I am using the server-side. I am getting the records using ajax. My issue is, search and pagination not working.
Read more >Datatable pagination not showing using serverSide
I am using JQuery Datatable to display data from database and everything works well except the pagination numbers are not showing and I ......
Read more >DataTables AJAX Pagination with Search and Sort - PHP
Create a new ajaxfile.php . Read the $_POST values and store in variables that are passed by DataTable during AJAX request – draw,...
Read more >Table Options - Bootstrap Table
The footer Object can be used to set/define footer colspans and/or the value of the footer. Only triggered when data-pagination is true and...
Read more >Column Search in DataTables using Server-side Processing
It provides a rich interface with effective sorting, search, pagination like features to manage a list of records. Using this we can list...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

The items provider function must return either an array directly, or a promise directly, or call a callback with the items array.
Since your
returnis inside athen, b-table will never receive you response.Thank you for your help! This is my code, it works when using serverside pagination:
Hope author can add the server side pagination,sort,filter example in the doc. I really don’t figure what items function for in the first time.
thank you!