spatie / vue-table-component

A straight to the point Vue component to display tables
http://vue-table-component.spatie.be
MIT License
588 stars 149 forks source link

Sorting and filter are not working with pagination #160

Closed marcoapferegrino closed 6 years ago

marcoapferegrino commented 6 years ago

Hello guys I am triying to implement pagination but my columns order and the input filter are not working. Its seems that when I click the column or input the data keeps in same state. *If i dont use asynchronously the normal order and filter are working well.

Here is my async function

async fetchData({ page, filter, sort }) {
                return new Promise(resolve=>{
                    axios.get(`/users?page=${page}`).then(response => resolve({
                        data: response.data.data,
                        pagination: {
                            totalPages: response.data.last_page,
                            currentPage: page,
                            count: response.data.total
                        }
                    }))
                })
            }

I notice each time I click on column and filter, the asyn function is executed, but is not ordering o something is happening in the middle of that. I did not found nothing in the documentation is this normal behavior or do i Need extra config?

I am using Laravel with pagination and it seem sis working because the pagination is working too but the order in the component is failing and I dont find any information in documentation I dont know is currently suppported