columnDefs php generated
columnDefs php generated
ltdeta
Posts: 23Questions: 9Answers: 0
How should I create this javascript columndefs
- data with php?
"columnDefs": [
{ "targets": [0,1], "searchable": false, "title": "column1"},
{ "targets": [2], "searchable": true, "title": "column2"}
]
the result should be
"columnDefs": data.ColumnDef //data.ColumnDef is generated outside the datatabletable object
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
I think you can do this with an ajax call before datatables are initiated, just not with the same call that loads the server-side data if you are using that. Below is a correctly formatted PHP array for your columnDefs example.