Comments (8)
@sdezza I am afraid that you didn't use the loading data when requesting new data from the server,
please try this:
methods: {
async getCalls(){
this.loading = true; // add this
await axios
.get(`/api/calls/?page=${this.serverOptions.page}`)
.then(response => {
this.items = response.data.results
this.serverItemsLength = response.data.count
this.loading = false // add this
})
.catch(error => {
console.log(error);
})
},
},
from vue3-easy-data-table.
@sdezza According to your response, If the second page is not the last page, It seems that your API is responding two rows for each page, so I think you should set the rowsPerPage
in serverOptions
to 2.
from vue3-easy-data-table.
Actually, It was an example of my response, in reality I have 10 items per page. But even changing rowsPerPage to 10 doesn't solve the problem
from vue3-easy-data-table.
@sdezza can you describe
the next pages are no more loaded
more detailedly? is the pagination button unavailable or the serverOptions
doesn't update?
from vue3-easy-data-table.
watch: {
serverOptions(value) {
this.serverOptions.page = value.page
this.getCalls()
},
},
this.serverOptions.page = value.page
βdoesn't seem to be necessary, and since you are watching an object variable (serverOptions
),
It is better to use a deep watcher.
watch: {
serverOptions: {
handler(value) {
this.getCalls();
},
deep: true,
}
},
from vue3-easy-data-table.
Thanks for the tips with deep watcher, I have updated my code (still with the same problem)
Here is the problem Flow:
- 1 Page is loaded wich is ok
- On click "Next", second page is loaded, which is also ok
- On click "Next" Again, Page 2 is always loaded instead of Page 3,4,5,.....
I really don't see where the problem comes from :/
from vue3-easy-data-table.
Works!! π
I thought this.loading was just handling the css loader...
Thanks for your support and this package
from vue3-easy-data-table.
@sdezza It will become very confusing when forgetting to use loading
, and I will solve this problem in the future version, thank you for reporting.
from vue3-easy-data-table.
Related Issues (20)
- Sorting and Snake Case Headers
- Table Header Become A Checkbox if Header Text is checkbox
- Fixed columns don't work with css-forced single line cells
- Reset to first page
- Make not all rows expandable when using "#expand='item'" HOT 1
- item slot with font awesome icons does not render, instead it renders some SVG
- Feature Request: Make sort arrow icons shown on initial load, then make it blue depending on the activated sort.
- How to access item slot for variable column names HOT 1
- Is this package deprecated? Because in Vuetify since 3.4.0 we have Data Tables HOT 3
- Is there is any way to expand a row to click on user_name instaed of icon? HOT 1
- is it possible to extend a row on cell click instead of icon click?
- How insert icon in the column with sorts (class='sortType-icon')
- Is there a slot for a complete row? HOT 2
- TypeError: itemsSearching.value is not iterable with serverSide mode HOT 1
- render HTML element (url) in table HOT 2
- Exposed typings for Footer Customization?
- Footer customization does not appear to work as described in docs? HOT 1
- Button pagination default style is different like example
- Sort not selected is confusing
- Access array within items object
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue3-easy-data-table.