Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-20743

Allow to provide custom data attribute in action links

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • None
    • 14.10.6
    • Live Data
    • None
    • Unknown

    Description

      My need is the following: I want a specific action link provided on a LiveData to be handled by a piece of javascript, which would use some data from the same row of the LiveData.

      Ideally I'd like to be able to define a dedicated data-attribute element that I could reuse when listening on the click event on my link, so to be able to define my action like this:

      {
              "id": "editapprovers",
              "allowProperty": "doc.haseditapprovers",
              "urlProperty": "doc.editapprovers_url",
              "icon": "wrench",
              "name": "$services.localization.render('changerequest.sheet.editapprovers.button')",
              "custom-data-location":"doc.location",
            }
      

      which would create in the dom:

      <a href="mylink" class="action action_editapprovers" data-location="the doc.location"><img src="/xwiki/resources/icons/silk/wrench.png"><span class="action-name">Edit approvers</span></a>
      

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              surli Simon Urli
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: