首页 > 解决方案 > Callback with Datatable.ajax.reload

问题描述

Hi I am trying to execute a statement after datable_name.ajax.reload(null, false); Below is mycode:

datable_name.ajax.reload(null, false);
$('#div_id').removeClass().addClass("text-green").html("Message").fadeIn();

My code is working, but the second line is not waiting for the complete execution of data table reload. I want second line should execute only after complete the execution of first line.

How I can do that. is there any way I can user call back in reload.?

I am using DataTables 1.10.11

标签: jquerydatatables

解决方案


尝试这个:

datable_name.ajax.reload(function() {
    $('#div_id').removeClass().addClass("text-green").html("Message").fadeIn();
},false);

推荐阅读