JavaScript UI Libraries & Blazor Components Suite – Smart UI Forums Accordion getting data element from accordion smart-accordion-item

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #100774

    hello – it appears as if using accordion is going to meet our needs perfectly if i can get past this issue.
    i need to be able to access data from the smart-accordion-item when an item is clicked:
    or perhaps there is there a better way to do this?
    using this.parentElement and this.parentNode does not appear to work for me.
    our smart element will contain thousands of accordion items, each with up to ten clickable items.  we need to keep the html as small as possible.


    Hi edwardsmarkf,
    You can get the AccordionItem instance using the Element.closest() method, like so:'smart-accordion-item'). Another approach is to use Event.composedPath() which will return all parents of the current target (including the AccordionItem).
    Best Regards,
    Smart HTML Elements Team

    Member'smart-accordion-item').dataset.labelname   😁
    this is exceptionally useful.  you might consider adding this in the documentation.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.