Control ajax pagination using query string
Control ajax pagination using query string
robin-n
Posts: 2Questions: 1Answers: 0
I'm fetching a JSON file where I need to be able to control pagination using query strings.
The output looks like this.
{
"PageIndex":1,
"PageSize":50,
"TotalFoundReleases":433,
"Releases":[
"item",
"item",
"item"
]
}
So, the URL looks something like this http://example.com/NewsFeed/A275CXXXXX
where I get page 1. Now, to get page 2 I append an ?pageIndex=2
How can I implement this in Datatables?
$('#example').dataTable({
"ajax": {
"url": "http://example.com/NewsFeed/A275CXXXXX`",
"dataSrc": "Releases",
},
"columns": [
{"data": "Title"},
{"data": "Intro"},
]
});
});
Fiddle here: https://jsfiddle.net/503yrwr8/
This discussion has been closed.
Answers
Solved!
https://jsfiddle.net/503yrwr8/5/
Searching and filtering wont work though.