i have a problem initializing the data table i have tried many options in the forums
i have a problem initializing the data table i have tried many options in the forums
himaantheone
Posts: 2Questions: 1Answers: 0
basically i have a search engine that sends a searchterm and retrieve results so i am getting that table cannot be reinitialised error following is my code-
var search = $("#grid-selection");
search.find(".dataTable").dataTable().fnDestroy();
var Searchterm = $('#Searchterm').val();
var table= $("#grid-selection").DataTable({
"ajax": {
"url": "Prime/Time/Search",
"type": "POST",
"data": { Searchterm: Searchterm },
"datatype": "json"
},
"scrollY": 350,
"scrollX": true,
"columns" : [
{ "data": "id", "autoWidth": true },
{ "data": "brieftitle", "autoWidth": true },
]
});
Edited by Allan - Syntax highlighting. Details on how to highlight code using markdown can be found in this guide.
This discussion has been closed.
Answers
Change:
to be:
Otherwise it is looking for tables inside the table you want!
Allan