Simplify relationship datatable code
authorColeman Watts <coleman@civicrm.org>
Wed, 4 May 2016 20:59:03 +0000 (16:59 -0400)
committerColeman Watts <coleman@civicrm.org>
Wed, 4 May 2016 20:59:03 +0000 (16:59 -0400)
templates/CRM/Contact/Page/View/RelationshipSelector.tpl

index 8c2b088d7eda3ebfe0ed14e6db194d442e99caf5..225d3b06d3fb5ca5bcd07c4db32110d85eb41099 100644 (file)
  +--------------------------------------------------------------------+
 *}
 {* relationship selector *}
-
 <div class="crm-contact-relationship-{$context}">
-  <table class="crm-contact-relationship-selector-{$context} crm-ajax-table" data-page-length='10'>
+  <table
+    class="crm-contact-relationship-selector-{$context} crm-ajax-table"
+    data-ajax="{crmURL p="civicrm/ajax/contactrelationships" q="context=$context&cid=$contactId"}">
     <thead>
     <tr>
       <th data-data="relation" class='crm-contact-relationship-type'>{ts}Relationship{/ts}</th>
     </tr>
     </thead>
   </table>
-
-  {literal}
-    <script type="text/javascript">
-      (function($) {
-        var context = {/literal}"{$context}"{literal};
-        CRM.$('table.crm-contact-relationship-selector-' + context).data({
-          "ajax": {/literal}'{crmURL p="civicrm/ajax/contactrelationships" h=0 q="context=$context&cid=$contactId"}'{literal},
-        });
-      })(CRM.$);
-    </script>
-  {/literal}
 </div>