<script type="text/javascript">
var empList = [ 'Kapil Sharma','David Linden','John Linden', "Harish Shree"]; var flag= true;
$(function () {
$('#list').ejComboBox({
dataSource: empList,
width: '250px',
placeholder: 'Select an employee',
popupWidth: '250px',
popupHeight: '300px',
open: function(args)
{
if(flag)
{
for (i=0;i< this.liCollections.length;i++)
{
var span = document.createElement("span");
span.classList="e-icon e-close";
this.liCollections[i].append(span);
}
flag=false;
}
},
select:function(args)
{
if(args.e.target.classList.contains("e-close"))
{
console.log("close icon is clicked");
// remove the item here based on your requirement.
}
}
});
});
</script> |