data attribute in dropdownshowhide.js

kristofv3501920

27-03-2018

AEM6.3 contains /libs/cq/gui/components/authoring/dialog/dropdownshowhide/clientlibs/dropdownshowhide/js/dropdownshowhide.js

At lines 49-50 there is this code:

        // get the selector to find the target elements. its stored as data-.. attribute

        var target = $(element).data("cqDialogDropdownShowhideTarget");

AFAIK data attributes are always lowercase. This is certainly the case if the data attributes are generated via granite:data node as per Common Attributes — Granite UI 1.0 documentation

When I change the code to

        var target = $(element).data("cqdialogdropdownshowhidetarget");

my select component works correctly.

Am I missing something?

View Entire Topic

kristofv3501920

28-03-2018

Yes, this is correct provided I generate my data attribute using

<granite:data
  jcr:primaryType="nt:unstructured"
  cq-dialog-dropdown-showhide-target=".list-option-listfrom-showhide-target">

</granite:data>