I'm using the Jquery Multi-select comboTree plugin and i would like to insert a selected elements count label inside combobox, but i'm not find a correct way to do this. I'm follow up the plugin documentation, that can be access here, but i can't developed a correct code to implement this.
Below, is the html code that receive data from plugin script:
<input type="text" id="select1" placeholder="Select">
and below is the plugin script that send data to html input mencioned above:
var myData = [
{
id: 0,
title: 'value 1 ',
subs: [
{
id: 10,
title: 'subvalue 1'
}, {
id: 11,
title: 'subvalue 2'
}
]
}, {
id: 1,
title: 'value 2',
subs: [
{
id: 10,
title: 'Item 2-1'
}, {
id: 11,
title: 'Item 2-2'
}, {
id: 12,
title: 'Item 2-3'
}
]
}, {
id: 2,
title: 'Item 3'
},
];
var select1 = $('#select1').comboTree({
source : myData,
isMultiple: true
});
What i would like to do is insert a selected count label inside combo as image below:
How can i improve/implement my code to do this?