3

Is there a reference anywhere for the in-line editing, e.g., 'Click Here to Edit' in CiviCRM? I need something similar for my extension and want to reuse as much as I can.

  • Please elaborate your question a little more and what are you trying to achieve? – Hassan Farooq Jan 9 '18 at 20:47
1

Assuming you have an API that allows to modify the entity you want (if it's a custom one, it's easy to add), adding a few classes should be enough to enable the edit in place. You need to define the entity that contain the field (class crm-entity, id "type-{id}" on a containing dom node and then "crm-editable crmf-{fieldname}". for example:

<table>
  <tr class="crm-entity" id="contact-123">

    <!-- textfield (default type) -->
    <td class="crm-editable crmf-first_name">Fred</td>

    <!-- select list with empty option -->
    <!-- (note: options will be fetched automatically by the api) -->
    <td class="crm-editable crmf-prefix_id"
        data-type="select"
        data-empty-option="{ts}- none -{/ts}">Mr.</td>

    <!-- yes/no select -->
    <td class="crm-editable crmf-is_deceased" data-type="boolean">
      No
    </td>

  </tr>
</table>

More details in the doc

https://docs.civicrm.org/dev/en/latest/framework/ui/#in-place-field-editing

  • Thanks. That link is just what I needed. Not sure why I couldn't find it before. – Mike Steigerwald Jan 14 '18 at 13:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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