Untitled

mail@pastecode.io avatar
unknown
php
7 months ago
887 B
2
Indexable
Never
<?php
require($_SERVER["DOCUMENT_ROOT"] . "/bitrix/header.php");

\Bitrix\Main\UI\Extension::load("ui");
\Bitrix\Main\UI\Extension::load("ui.select");


?>
    <input type="text" id="select">
    <script>
      BX.ready(() => {
        const options = [
          {
            value: '1',
            label: 'the Union of Soviet Socialist Republics'
          },
          {
            value: '2',
            label: 'Deutch'
          },
          {
            value: '3',
            label: 'England'
          },
        ]
        
        const select  = new BX.Ui.Select({
          options,
          value:              '12',
          isSearchable:       true,
          containerClassname: '',
        });
        select.subscribe('update', (e) => {
          // some code here
        });

        select.renderTo(document.getElementById('select'));
      });
    </script>
Leave a Comment