How to hide selecteditem in the igCombo
Removing and adding back items to the igCombo for http://www.infragistics.com/community/forums/t/95697.aspx
HTML
<script src="http://igniteui.com/js/modernizr.min.js"></script>
<script src="http://code.jquery.com/ui/1.11.4/jquery-ui.min.js"></script>
<script src="http://cdn-na.infragistics.com/igniteui/latest/js/infragistics.core.js"></script>
<script src="http://cdn-na.infragistics.com/igniteui/latest/js/infragistics.lob.js"></script>
<link href="http://cdn-na.infragistics.com/igniteui/latest/css/structure/infragistics.css" rel="stylesheet"></link>
<link href="http://cdn-na.infragistics.com/igniteui/latest/css/themes/infragistics/infragistics.theme.css" rel="stylesheet"></link>
<p>
<button id="removeSelected"> Remove selected item</button>
<button id="restore"> ↶ Restore last item</button>
</p>
<select id="combo">
<option value="1">John Smith</option>
<option value="2">Mary Johnson</option>
<option value="3">Bob Ferguson</option>
</select>
JavaScript
$(function () {
var removedItems = [];
//The igCombo is bound to the SELECT and OPTION elements
//defined above
var $combo = $("#combo");
$combo.igCombo({ filterExprUrlKey: 'filter', compactData: true, valueKey: 'Value', textKey: 'Text', placeHolder: 'All', inputName: 'FirstName', loadOnDemandSettings: { enabled: false }, dataSource: [{"Text":"KARTHIKEYAN","Value":null},{"Text":"DONALD","Value":null},{"Text":"DANIEL M.","Value":null},{"Text":"KRISHNAN V.","Value":null},{"Text":"SPIKE","Value":null},{"Text":"ARUNA S","Value":null},{"Text":"SWATHI","Value":null},{"Text":"EMMA C.","Value":null},{"Text":"ELANGO","Value":null},{"Text":"THEODORE","Value":null},{"Text":"KRISHNAN","Value":null},{"Text":"BEN","Value":null},{"Text":"KIRAN L","Value":null},{"Text":"BRIAN","Value":null},{"Text":"GURUNATHAN","Value":null},{"Text":"SRAVANI","Value":null},{"Text":"PRUDHVI","Value":null},{"Text":"VENKATESH","Value":null},{"Text":"WEBTESTQA","Value":null}] });
$("#removeSelected").on("click", function () {
var index = $combo.igCombo("selectedIndex");
if (index >= 0) {
var dataSource = $combo.igCombo("getDataSource");
//in case of filtered results/index
var item = dataSource.dataView()[index];
index = dataSource.data().indexOf(item);
// save for undo:
removedItems.push({ data: item, index: index });
dataSource.removeRecordByIndex(index);
//re-bind and clear selection
$combo.igCombo("dataBind").igCombo("selectedIndex", -1);
}
});
$("#restore").on("click", function () {
if (removedItems.length) {
var item = removedItems.pop();
var dataSource = $combo.igCombo("getDataSource");
// add the item back (preferably in its old position)
dataSource.insertRow(item.index, item.data, item.index, true);
...