Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82235

Data Format for Server Side

$
0
0

Hello,

I want to send paginated data to DataTables from my Spring based backend. So far I have managed to get the response to look like:

{
   "draw":1,
   "recordsTotal":57,
   "recordsFiltered":57,
   "data":[
      {
         "salesno":"P12345",
         "start_date":"01/09/2017",
         "address":"2 Some Road, Los Angeles",
         "Entry":false,
         "names":"PITT & ANISTON"
      },

Question: Do I need to change the inner { to [ - like below:

{
   "draw":1,
   "recordsTotal":57,
   "recordsFiltered":57,
   "data":[
      [
         "salesno":"P12345",
         "start_date":"01/09/2017",
         "address":"2 Some Road, Los Angeles",
         "Entry":false,
         "names":"PITT & ANISTON"
      ],

And if so what would the best way to do this be? Client or Server side? And if Client side does DataTables have a way to help with this situation?

Thanks

Al


Viewing all articles
Browse latest Browse all 82235

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>