Yes, you can now add groups with dataprovider
thanks to this pull request
See the documentation on .multiselect('dataprovider', data)
.
You can compose like this:
<!-- language: lang-js -->
var data = [{
title: 'First group',
children: [{ label: 'Cheese', value: 'cheese' },
{ label: 'Tomatoes', value: 'tomatoes' }]
}, {
title: 'Second group',
children: [{ label: 'Mozzarella', value: 'mozzarella' },
{ label: 'Mushrooms', value: 'mushrooms' }]
}];
$('.multiselect').multiselect('dataprovider', data);
<!-- language: lang-html -->
<select class="multiselect" multiple="multiple"></select>