How to get next data with pagination in Quasar Framework?



  • I want to use datatable with server pagination in Quasar Framework, I already try the example, but I didn’t get it if my Rest API return this kind of JSON,

    {
    "count": 808,
    "next": "http://localhost:8000/v1/assets?expand=village.subdistrict.city.province&page=2",
    "previous": null,
    result: [
            { id: 1, name: 'Frozen Yogurt', calories: 159, fat: 6.0, carbs: 24, protein: 4.0, sodium: 87, calcium: '14%', iron: '1%' },
            { id: 2, name: 'Ice cream sandwich', calories: 237, fat: 9.0, carbs: 37, protein: 4.3, sodium: 129, calcium: '8%', iron: '1%' },
            { id: 3, name: 'Eclair', calories: 262, fat: 16.0, carbs: 23, protein: 6.0, sodium: 337, calcium: '6%', iron: '7%' },
            { id: 4, name: 'Cupcake', calories: 305, fat: 3.7, carbs: 67, protein: 4.3, sodium: 413, calcium: '3%', iron: '8%' },
    ]
    }
    

    I think the documentation doesn’t explain this case.
    How can I use ‘next’ and ‘previous’ to fetch the next or previous page ?




Log in to reply