vue3 serverside example

vue3 serverside example

newjohnnewjohn Posts: 2Questions: 1Answers: 0

Could someone give me an example of serverside?
I am using vue3, axios without jquery. The parameters I sent to backend are size, current for pagenation
and returned parameters are current, size, total and data.
I go through server-side processing page and still don't how to use it.
Thank you

Answers

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    I don't have a Vue specific example of server-side processing, but it is basically just the standard Vue example plus the serverSide option.

    You need to make sure that whatever your server-side script is, that it is expecting and returning the parameters described here.

    Perhaps you can show me the JSON return you are currently getting?

    Allan

  • newjohnnewjohn Posts: 2Questions: 1Answers: 0
    edited September 10

    I click a button to get data like below

    { "code": "ok", "data": { "records": [ { // data }, ... ], "total": 2, "size": 10, "current": 1 } }

    Can tag DataTable use attribiute

    "ajax": { "url": '/FillIssueTable', "type": "POST"}

    Thank you

  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin

    Okay, so the response doesn't match what DataTables expects (per the documentation I linked to).

    If you can't rename the parameters, use the ajax.dataSrc option (in its object form) to tell DataTables where to map the parameters to.

    Allan

Sign In or Register to comment.