jquery - 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
解决方案
尝试这个:
datable_name.ajax.reload(function() {
$('#div_id').removeClass().addClass("text-green").html("Message").fadeIn();
},false);
推荐阅读
- arrays - 内存中多维数组的表示
- python - pip3 无法在树莓派上安装 .whl 文件:文件不是 zip 文件
- cuda - Visual Studio 下划线为红色,但编译器完美运行
- c# - 将带有表情符号unicode格式的字符串转换为带有单个字符表情符号的字符串
- python - 如何访问python字典中的某个列表条目?
- ocaml - 将 ocamlformat 与 cppo 和 dune 一起使用
- xamarin - 使用 Appium 测试框架为 Windows 驱动程序编写测试时遇到问题
- git - 我在 Git/BitBucket 地狱
- mysql - Excel 日期无法转换为所需格式
- python - Snakemake:wildcard.wildcard_name 和 {wildcard} 之间的区别?