sangueroots

datatable api

Feb 28th, 2019
64
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(document).ready(function() {
  2.   var dt = $('#example').dataTable();
  3.   dt.fnDestroy();
  4. });
  5.  
  6. $(document).ready(function() {
  7.   var url = 'https://reqres.in/api/users';
  8.   var table = $('#example').DataTable({
  9.     ajax: url,
  10.     columns: [
  11.     {data: 'id'},
  12.     {data: 'first_name'}
  13.     ]});
  14. });
RAW Paste Data