JavaScript UI Libraries & Blazor Components Suite – Smart UI Forums Editor & Inputs How do I combine Input with native ES modules?

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #112906
    michaelsanders
    Participant

    Can I use Smart.MultiComboInput with a REST API? What data-fetching libraries are compatible?

    #112911
    Markov
    Keymaster

    Hi,

    Yes, you can use it. For example:

    
    <smart-multi-combo-input id="employees"></smart-multi-combo-input>
    
    <script>
        const multiCombo = document.getElementById('employees');
    
        // Fetch data from REST API
        fetch('https://api.example.com/employees')
            .then(response => response.json())
            .then(data => {
                // Assuming API returns: [{id:1, name:"Alice"}, {id:2, name:"Bob"}]
                multiCombo.dataSource = data.map(emp => emp.name);
            })
            .catch(error => console.error('Error fetching employees:', error));
    </script>

    Best regards,
    Markov

    Smart UI Team
    https://www.htmlelements.com/

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