本文介绍了如何在Jj数据库中完成SAjaxsource之后调用javascript函数的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用JQuery SAjaxsource如何在SAjaxsource完成后调用javascript函数。我想在datatable加载完成后更新一个div。请帮助我...

I'm using JQuery SAjaxsource How can i Call a javascript function after SAjaxsource completes. I want to update a div after the completion of the datatable load.Please help me...

编辑:

$(document).ready( function() {
                var oTable = $('#example').dataTable( {

                    "bServerSide": true,
                                    "sSearch":false,
                                    "aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]],
                                    "bPaginate": true,
                                    "bJQueryUI": true,
                                    "sPaginationType": "full_numbers",
                                    "sAjaxSource": "server_processingCDB1.php"
                } );


推荐答案

也适用于此,并保存您需要覆盖fnServerDa

http://datatables.net/ref#fnDrawCallback also works for this, and saved you needing to override fnServerData.

strong>类型:功能

Type: function

输入: {object}:DataTables设置对象

Inputs: {object}: DataTables settings object

这个函数在每个'draw'事件上被调用,并允许你
动态修改你想要创建的DOM的任何方面。

This function is called on every 'draw' event, and allows you to dynamically modify any aspect you want about the created DOM.



$(document).ready( function() {
  $('#example').dataTable( {
    "fnDrawCallback": function( oSettings ) {
      alert( 'DataTables has redrawn the table' );
    }
  } );
} );

这篇关于如何在Jj数据库中完成SAjaxsource之后调用javascript函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 13:44