Last week I moved to the newest version of Select2 (4.0.0.). Everything works as expected expect selecting group option.
Eg: I want to select Customer1 (id: c1) to show items belonging to all customer's projects.
Before v4.0. this was possible with simple adding an ID to each select group item, since v.4.0 this doesn't work anymore... Any suggestion, please?
var items = [
{
id: 'c1',
text: 'Customer1',
children: [
{ id: '1', text: 'Project1' },
{ id: '2', text: 'Project2' },
]
},
{
id: 'c2',
text: 'Customer2 ',
children: [
{ id: '3', text: 'Project1' },
{ id: '4', text: 'Project2' },
]
}
];
$('select').select2({
placeholder: "Select customer/project",
data: items
});