Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
435
How to hide selecteditem in the igCombo
posted

Hi, 

I selected an item in the dropdown list and then click other button, this selected item should be hidden in the drop-down list. It is still showing in the list when I clicked dropdown. 

Below is the code that I created.

<select id="combo">
<option value="1">John Smith</option>
<option value="2">Mary Johnson</option>
<option value="3">Bob Ferguson</option>
</select>

<script>
$(function () {

//The igCombo is bound to the SELECT and OPTION elements
//defined above
$("#combo").igCombo({
dropDownWidth: 400,
filteringType: "local",
autoComplete: true
});

var item = $("#combo").igCombo("itemByValue", "2");
$(item.element).hide();
$(item.element).css("display","none");

var item2 = $("#combo option");

$("#combo option").each(function(index, element){
if(element.value === "2")
{
$(element).hide();
$(element).css("display","none");
}
})

});
</script>