From: kurund Date: Sat, 1 Mar 2014 22:05:33 +0000 (+0530) Subject: refresh all datatables on the page during enable/disable action CRM-14201 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=0cb182f6454b1aeae4522d756ba6582a3243c8ad;p=civicrm-core.git refresh all datatables on the page during enable/disable action CRM-14201 ---------------------------------------- * CRM-14201: Contact Relationships tab needs pagination http://issues.civicrm.org/jira/browse/CRM-14201 --- diff --git a/templates/CRM/common/enableDisableApi.tpl b/templates/CRM/common/enableDisableApi.tpl index 63beb1fdcc..9857557de7 100644 --- a/templates/CRM/common/enableDisableApi.tpl +++ b/templates/CRM/common/enableDisableApi.tpl @@ -33,6 +33,17 @@ // 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 {