creativetimofficial / ct-soft-ui-dashboard-pro

Soft UI Dashboard Pro - Bootstrap 5 Admin
34 stars 6 forks source link

How to use Choicejs. #51

Closed dirosv-eden closed 2 years ago

dirosv-eden commented 2 years ago

How i can to use choice.js ?? I bought soft-ui-dashboard-pro (html version) but i don't see documentation about choice-js. i want to khow how to use choicejs ?

github-actions[bot] commented 2 years ago

@dirosv-eden this issue was automatically closed because it did not follow the bellow rules:


IMPORTANT: Please use the following link to create a new issue:

https://www.creative-tim.com/new-issue/soft-ui-dashboard-pro

**If your issue was not created using the app above, it will be closed immediately.**

Love Creative Tim? Do you need Angular, React, Vuejs or HTML? You can visit:
👉  https://www.creative-tim.com/bundles
👉  https://www.creative-tim.com

groovemen commented 2 years ago

Hello @dirosv-eden,

Thank you for using our products and for your feedback. We'll add more info to our documentation. Please check the Choices page: https://www.creative-tim.com/learning-lab/bootstrap/choices/soft-ui-dashboard. So you'll nee to create a structure like this:

<select class="form-control" name="yourID" id="yourID" placeholder="Choices">
  <option value="Choice 1" selected="">Brazil</option>
  <option value="Choice 2">Bucharest</option>
  <option value="Choice 3">London</option>
  <option value="Choice 4">USA</option>
</select>

and for the initialization, use this script:

if (document.getElementById('yourID')) {
    var element = document.getElementById('yourID');
    const example = new Choices(element, {
      searchEnabled: false // in case you don't need the search field
    });
};

Don't forget to include the plugin's script file into your page. Hope this information helps you. Please let us know if we can help you with anything else.

All the best, Stefan