From 0cb182f6454b1aeae4522d756ba6582a3243c8ad Mon Sep 17 00:00:00 2001 From: kurund Date: Sun, 2 Mar 2014 03:35:33 +0530 Subject: [PATCH] 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 --- templates/CRM/common/enableDisableApi.tpl | 11 +++++++++++ 1 file changed, 11 insertions(+) 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 { -- 2.25.1