refresh all datatables on the page during enable/disable action CRM-14201
authorkurund <kurund@civicrm.org>
Sat, 1 Mar 2014 22:05:33 +0000 (03:35 +0530)
committerkurund <kurund@civicrm.org>
Sat, 1 Mar 2014 22:05:33 +0000 (03:35 +0530)
----------------------------------------
* CRM-14201: Contact Relationships tab needs pagination
  http://issues.civicrm.org/jira/browse/CRM-14201

templates/CRM/common/enableDisableApi.tpl

index 63beb1fdcc9cdfeebabb7b3367402d0f9e74e8e1..9857557de711fefc4b1861f7ec6465192947a60b 100644 (file)
       // 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')) {
+            currentTable.block();
+            if ($.fn.DataTable.fnIsDataTable(currentTable[0]) && currentTable.dataTable().fnSettings().sAjaxSource) {
+              $(this).unblock().dataTable().fnDraw();
+            }
+          }
+        });
       }
       // Otherwise refresh the content area using crmSnippet
       else {