Calling Datatable ajax only on external button click.

Calling Datatable ajax only on external button click.

JDUiJDUi Posts: 2Questions: 1Answers: 0
edited March 2022 in DataTables 1.10

I have 2 parameters and depending on that I need data in the data table. I'll use click to fill the data table.
The ajax doesn't get called on page load(no error in console of browser), but I get an error (invalid Json) on reload function call and my server method doesn't gets called. I'll need to call server side code for sorting, paging and searching. Kindly help.
My code

$(table).DataTable({
serverSide:true, 
sAjaxSource:Controller/Action,
fnServerData:function(){
}, 
deferLoading:0
});

$(button).click(function()
{
$(table).DataTable().ajax.reload();
});

This question has an accepted answers - jump to answer

Answers

Sign In or Register to comment.