1

I need to make a change where some of the contact identifiers (extension Identity Tracker) can not be changed by the user. I can do that with the validateForm hook. But the Contact Identities are actually custom data of the type "tab with table" and you can also edit them inline.

The custom data tab with table uses the jQuery dataTables, and do not respect any hook unfortunately. In the is a with the class "crm-editable-enabled". If I can change that class to "crm-editable-disabled" I would be fine, but I have no idea how to do that with the dataTables API and the documentation shows stuff like this:

CRM.$(function($) {
  var myTable = $('.dataTable').DataTable();
  myTable
          .columns('.crm-editable')
          .nodes()
          .flatten()  // Reduce to a 1D array
          .to$()      // Convert to a jQuery object
          .removeClass('crm-editable-enabled')
          .addClass('crm-editable-disabled');
});

I can get the var myTable, but the rest does not seem to have any effect....any ideas?

1 Answer 1

-2

how about using apiwrapper hook and throwing exception?

1
  • 1
    I have no idea what you are talking about? Don't overestimate me please @Pradeep :-) You will have to give me a little more detail to be of any help. Commented Jun 17, 2020 at 17:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.