<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to use leonardoui.popover() in extension? in Integration, Extension &amp; APIs</title>
    <link>https://community.qlik.com/t5/Integration-Extension-APIs/How-to-use-leonardoui-popover-in-extension/m-p/1688694#M12558</link>
    <description>&lt;P&gt;I want to use code similar to the example that I found on the github page&amp;nbsp;(&lt;A href="https://qlik-oss.github.io/leonardo-ui/popover.html" target="_blank"&gt;https://qlik-oss.github.io/leonardo-ui/popover.html&lt;/A&gt;)&amp;nbsp;but I get an error on leonardoui.popover() that it is undefined which I think means I need to reference the library.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ex2.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/30797iD97DD6838320832A/image-size/large?v=v2&amp;amp;px=999" role="button" title="ex2.png" alt="ex2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I tried adding it to the define section of my code hoping that it would be a global object similar to ‘qlik’, but that did not work.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;define( [ "qlik","leonardoui","jquery","./script","./properties","./helper","text!./style.css"
],
function ( qlik,leonardoui,$,script,props,utils,cssContent) {&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So..do I have to download the entire leonardoui package from github and bundle it with every extension that I want to be able to use the leonardoui methods or is there a way to reference a global version of leonardoui that presumably runs within Qliksense by default?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example From Documentation that I am trying to replicate:&amp;nbsp;(&lt;A href="https://qlik-oss.github.io/leonardo-ui/popover.html" target="_blank"&gt;https://qlik-oss.github.io/leonardo-ui/popover.html&lt;/A&gt;)&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var popoverTriggers = document.querySelectorAll( ".example-box .popover-trigger" );
  popoverTriggers = [].slice.apply( popoverTriggers ); // convert to array
  popoverTriggers.forEach( function ( element, idx ) {
    element.addEventListener( "click", function() {
      var popover = leonardoui.popover( {
        content: element.nextElementSibling.innerHTML,
        closeOnEscape: true,
        dock: idx === 0 ? "bottom" : "right",
        alignTo: element
      } );
      // Popover was shown
      var closeButton = popover.element.querySelectorAll( ".close-button" )[0];
      closeButton.addEventListener( "click", function() {
        popover.close();
      } );
    } );
  } );&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Nov 2024 02:51:17 GMT</pubDate>
    <dc:creator>devan9876</dc:creator>
    <dc:date>2024-11-16T02:51:17Z</dc:date>
    <item>
      <title>How to use leonardoui.popover() in extension?</title>
      <link>https://community.qlik.com/t5/Integration-Extension-APIs/How-to-use-leonardoui-popover-in-extension/m-p/1688694#M12558</link>
      <description>&lt;P&gt;I want to use code similar to the example that I found on the github page&amp;nbsp;(&lt;A href="https://qlik-oss.github.io/leonardo-ui/popover.html" target="_blank"&gt;https://qlik-oss.github.io/leonardo-ui/popover.html&lt;/A&gt;)&amp;nbsp;but I get an error on leonardoui.popover() that it is undefined which I think means I need to reference the library.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ex2.png" style="width: 999px;"&gt;&lt;img src="https://community.qlik.com/t5/image/serverpage/image-id/30797iD97DD6838320832A/image-size/large?v=v2&amp;amp;px=999" role="button" title="ex2.png" alt="ex2.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I tried adding it to the define section of my code hoping that it would be a global object similar to ‘qlik’, but that did not work.&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;define( [ "qlik","leonardoui","jquery","./script","./properties","./helper","text!./style.css"
],
function ( qlik,leonardoui,$,script,props,utils,cssContent) {&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So..do I have to download the entire leonardoui package from github and bundle it with every extension that I want to be able to use the leonardoui methods or is there a way to reference a global version of leonardoui that presumably runs within Qliksense by default?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example From Documentation that I am trying to replicate:&amp;nbsp;(&lt;A href="https://qlik-oss.github.io/leonardo-ui/popover.html" target="_blank"&gt;https://qlik-oss.github.io/leonardo-ui/popover.html&lt;/A&gt;)&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var popoverTriggers = document.querySelectorAll( ".example-box .popover-trigger" );
  popoverTriggers = [].slice.apply( popoverTriggers ); // convert to array
  popoverTriggers.forEach( function ( element, idx ) {
    element.addEventListener( "click", function() {
      var popover = leonardoui.popover( {
        content: element.nextElementSibling.innerHTML,
        closeOnEscape: true,
        dock: idx === 0 ? "bottom" : "right",
        alignTo: element
      } );
      // Popover was shown
      var closeButton = popover.element.querySelectorAll( ".close-button" )[0];
      closeButton.addEventListener( "click", function() {
        popover.close();
      } );
    } );
  } );&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Nov 2024 02:51:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/Integration-Extension-APIs/How-to-use-leonardoui-popover-in-extension/m-p/1688694#M12558</guid>
      <dc:creator>devan9876</dc:creator>
      <dc:date>2024-11-16T02:51:17Z</dc:date>
    </item>
  </channel>
</rss>

