Uploaded image for project: 'CiviCRM'
  1. CiviCRM
  2. CRM-14636

Datatables implimentation causes dom collisions

    Details

    • Type: Bug
    • Status: Done/Fixed
    • Priority: Critical
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.5
    • Fix Version/s: 4.5
    • Component/s: None
    • Labels:
      None

      Description

      Our current implementation of datatables relies too heavily on dom IDs.
      The table itself has an id and we use that to initialize it. Some of the column headers also have ids and we use them for sorting.
      This causes js breakage when multiple tabs and popups all contain datatables.
      The task is to fix our datatables so they either have no ids at all (which is my preferred solution) or else to make the ids much more likely to be unique by making them a concatenation of form-entity-entity_id-etc.
      Either way, you should scope all the javascript that deals with datatables so it is limited to the containing form/page. For example most smarty-form js can be scoped like this:
      var $form = $("#

      {/literal}

      {$form.formName}

      {literal}

      ");
      $('.datatable', $form).doSomething();

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                colemanw Coleman Watts
                Reporter:
                colemanw Coleman Watts
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: