JavaScript UI Libraries & Blazor Components Suite – Smart UI › Forums › ComboBox › combining "dataSource" and item template › Reply To: combining "dataSource" and item template
November 20, 2020 at 7:20 am
#101158
admin
Keymaster
Hi,
You can combine these without a problem.
<smart-combo-box item-template="template"> </smart-combo-box> <template id="template"> <span class="glyphicon glyphicon-ok">test</span> <span style="margin-left:5px;">{{label}}</span> </template>
JS Code
window.onload = function() {
const combobox = document.querySelector(‘smart-combo-box’);
combobox.dataSource = [“new item 1”, “new item 2”];
}
Best regards,
Peter Stoev
Smart UI Team
https://www.htmlelements.com/