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

Load first 10 data from API

$
0
0

Hi Sir,

Just want to ask regarding in API..

I have an API almost 4,000 plus data...
is there possible in DataTable to load first 10 then when i press page 2,
another 10 will load again? without loading all 4,000 plus first before showing
in datatable.

coz in my situation now it will load all 4,000 data for almost 30 seconds before showing in datatable...

Here's my code:
$(document).ready(function(){
var table = $('#example').DataTable( {
dom: 'Bfrtip',
lengthChange: false,
buttons: [ 'copy', 'excel', 'pdf', 'colvis' ],
ajax: {
url: "http://sample/demo"
},
columns: [
{ "data": "Id" },
{ "data": "company_uid" },
{ "data": "refNumber" },
{ "data": "requestFrom" },
{ "data": "requestTo" },
{ "data": "amount" },
{ "data": "requestNetwork" },
{ "data": "requestStatus" },
{ "data": "flag" },
{ "data": "updated_at" },
{ "data": "created_at" }
]
} );
});

Thank You


Viewing all articles
Browse latest Browse all 82273

Trending Articles



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