vue3 serverside example
vue3 serverside example
newjohn
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
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
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
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