ratiw / vue-table

data table simplify! -- vuetable is a Vue.js component that will automatically request (JSON) data from the server and display them nicely in html table with swappable/extensible pagination component.
MIT License
1.83k stars 303 forks source link

Pagination not being displayed #81

Closed maurocasas closed 8 years ago

maurocasas commented 8 years ago

I've been trying to get my pagination running using Laravel 5.3, but apparently pagination JSON response has changed. I cannot get the pagination to display, nor the counter of results which displays "No relevant data"

My table code is

        <vuetable
            api-url="/api/students"
            table-wrapper=".vuetable-wrapper"
            :fields="columns"
            :item-actions="itemActions"
            pagination-component="vuetable-pagination"
        ></vuetable>

And the JSON response is

{"total":57,"per_page":10,"current_page":1,"last_page":6,"next_page_url":"http:\/\/allyconnect.app\/api\/students?page=2","prev_page_url":null,"from":1,"to":10,"data":[]}

Thanks for the help!

ratiw commented 8 years ago

@maurocasas You need to set pagination-path="". This is because the default pagination-path is pointing to links.pagination while laravel's pagination is at the root of the data. See here

maurocasas commented 8 years ago

You're the man!