.click and Load data from json file
.click and Load data from json file
extjac
Posts: 13Questions: 6Answers: 0
Hello, how i can i make bellow code works?
<
script type="text/javascript">
$(document).ready(function()
{
//it works
$('#example').dataTable( {
"ajax": "data1.json"
} );
});
//It does not work
$( "#btnLoadData" ).click(function()
{
$.getJSON( "data1.json", function( data ) {
$('#example').dataTable( {
"ajax": data
} );
});
});
});
This discussion has been closed.
Answers
anyone please? I am trying to implement a search and pass parameters to datatable.
What is
data
? The data you want to display in the table? In which case usedata
notajax
.Allan