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

Migrate Custom Data Tabs to use LivePage AJAX

    Details

    • Type: Task
    • Status: Done/Fixed
    • Priority: Major
    • Resolution: Fixed/Completed
    • Affects Version/s: 4.4.0
    • Fix Version/s: 4.5
    • Component/s: None
    • Labels:
      None

      Description

      Need to migrate custom data tabs to use LivePage ajax helper. Existing js/ajax code is old and has some bugs/limitations:

      • Page jumps around when you click on a link
      • Can't right-click a link to open in a new browser tab
      • Forms don't submit via ajax
      • Popup has no title and no .crm-container css class for styling
      • crmLoad events not triggered, so not compatible with select2 or entityRef widgets

      So the first task is to get rid of all that old code and strip everything back to simple non-ajax functionality:

      • Remove all js for handling links and popups in custom data tabs
      • Remove associated ajax callbacks or json outputs if any
      • Ensure all forms are working in simple non-ajax mode.
      • Make sure no redirects are being issued from the form layer as that breaks livePage functionality - use session->pushUserContext as an alternative.

      Then enable the new ajax with 2 lines of code:

      You should notice some nice improvements. FYI if you were to add "save and new" button to a popup form livePage is smart enough to handle that

        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: