Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Installation

You can find our flex components at our CDN, use the link below to get our latest changes.

Code Block
<script src="https://static.ambita.com/infoland-components/components.umd.js"></script>

Usage

Add the script tag to head and use the library after the dom is ready

Code Block
languagehtml
<!DOCTYPE html>
<html>
<head>
 
<title>Page Title</title>   <script src="https://staticdev-meglerpakke.ambita.com/infoland-package/mflex/Ambita.umd.js" charset="utf-8"></script>
</head>
<body>
  <h1>
    Welcome to Ambita Infoland components!
  </h1>
  <div id="search" style="height: 75px"></div>
  <div id="infolandproduct-list"></div>
  <button id="buttonconfirm">Confirm click>Open Infoland<order</button>

 <script type="text/javascript"> <script>
    document.addEventListener('DOMContentLoaded', () => {
      window.Ambita.InfolandmFlex.init({
        environment: 'beta',
        token: {
          access_token: '74246ace-f71f-423f-951a-8a9816a3319a',
          token_type: 'Bearer',
          expires_in: 3600,
          refresh_token: '80194947-73f6-47f6-92ca-66803abb7686',
          scope:['infoland...flex'],
          expires_at: '2022-09-27T07:47:49.774Z'
        },
        reference: 'test'
      });

      window.Ambita.mFlex.search.onSearchResult = (result) => {
     const button = documentconsole.getElementByIdlog("button"result);
      };

      window.Ambita.mFlex.search.load('#search');

      button.addEventListener('click', (e) => {window.Ambita.mFlex.productList.load('#product-list', {
        share:{},
        cadastre:{
          knr: '0301',
          gnr: '224',
          bnr: '64',
          snr: '18'
        }
      });

      const confirmButton = Ambita.Infoland.load(document.getElementById('confirm');
      confirmButton.addEventListener('click', async () => {
        const orderNumber = await window.Ambita.mFlex.productList.confirmOrder();

       } console.log(orderNumber);
      });
    })();
  </script>
</body>
</html>

See Usage for more information about how to use the init and load functions.