Refresh Datatable Difficulties
Refresh Datatable Difficulties
I'm struggling to find a way to refresh my data table. It is currently set up and being populated in this manner:
[code]
function AjaxCall() {
// Send ajax call
SendAjax("/Services/EventHandler?SomeHandler", null, SuccessFunction, DebugAjaxFailure);
}
[/code]
[code]
function SuccessFunction(data)
{
$('#myDataTable').dataTable(
{
"bFilter": false,
"bPaginate": false,
"bSort": false,
"bDestroy":true,
"aaData": data,
"aoColumns": [
{ "mData": "SomeData" },
{ "mData": "SomeOtherData" },
{ "mData": "MoreData" },
{
"mData": "DataId",
"mRender": function (rowData, type, full)
{
return 'Edit / Delete';
}
}
]
}
);
}
[/code]
Then when I edit the table, I want to be able to "Save" the table and refresh it. What would be the best way to go about this? I have tried [code]fnDraw[/code], but that won't recall the Ajax call.
[code]
function AjaxCall() {
// Send ajax call
SendAjax("/Services/EventHandler?SomeHandler", null, SuccessFunction, DebugAjaxFailure);
}
[/code]
[code]
function SuccessFunction(data)
{
$('#myDataTable').dataTable(
{
"bFilter": false,
"bPaginate": false,
"bSort": false,
"bDestroy":true,
"aaData": data,
"aoColumns": [
{ "mData": "SomeData" },
{ "mData": "SomeOtherData" },
{ "mData": "MoreData" },
{
"mData": "DataId",
"mRender": function (rowData, type, full)
{
return 'Edit / Delete';
}
}
]
}
);
}
[/code]
Then when I edit the table, I want to be able to "Save" the table and refresh it. What would be the best way to go about this? I have tried [code]fnDraw[/code], but that won't recall the Ajax call.
This discussion has been closed.
Replies
Allan