Client-side Ajax
DataTables loads the whole dataset from a URL once (here a 200-row JSON file), then pages/sorts/searches client-side. Configure it purely through the ajax option.
| ID | Name | Position | Office | Age | Start date | Salary | Status |
|---|
options: Config = {
ajax: 'data/employees.json', // string URL, an object, or a function
columns: [
{ data: 'id', title: 'ID' },
{ data: 'name', title: 'Name' },
{ data: 'position', title: 'Position' },
{ data: 'office', title: 'Office' },
{ data: 'age', title: 'Age' },
{ data: 'startDate', title: 'Start date' },
{ data: 'salary', title: 'Salary' },
{ data: 'status', title: 'Status' },
],
};