code cleanup, CRM-14201
authorkurund <kurund@civicrm.org>
Sun, 2 Mar 2014 18:19:42 +0000 (23:49 +0530)
committerkurund <kurund@civicrm.org>
Sun, 2 Mar 2014 18:19:42 +0000 (23:49 +0530)
----------------------------------------
* CRM-14201: Contact Relationships tab needs pagination
  http://issues.civicrm.org/jira/browse/CRM-14201

templates/CRM/common/enableDisableApi.tpl

index 86d4f86eb571e10c08130695ec9e102451c96bab..d1b3cb1cb9d8f080101c7369175f67ae4728ad46 100644 (file)
     function refresh() {
       // Call native refresh method on ajax datatables
       if ($.fn.DataTable.fnIsDataTable($table[0]) && $table.dataTable().fnSettings().sAjaxSource) {
-        $table.unblock().dataTable().fnDraw();
-
-        // incase of more than 1 datatables on same page, refresh remaining datatables
-        $('table.dataTable').each(function () {
-          var currentTable = $(this);
-          if (currentTable.prop('id') != $table.prop('id')) {
-            if ($.fn.DataTable.fnIsDataTable(currentTable[0]) && currentTable.dataTable().fnSettings().sAjaxSource) {
-              currentTable.dataTable().fnDraw();
-            }
-          }
+        $.each($.fn.dataTable.fnTables(), function() {
+          $(this).dataTable().fnSettings().sAjaxSource && $(this).unblock().dataTable().fnDraw();
         });
       }
       // Otherwise refresh the content area using crmSnippet