I am using kendo autocomplete and datasource is hardcoded.i have to show the items in the autocomplete which are not selected.So i have to hide the values which are already selected.For that i am using the following code
// create a datasource bound to the local data
var status = [
"Accountable",
"Collection",
"Write Off"
];
//Lookup
$("#collection_status").kendoAutoComplete({
dataSource : status,
filter : "startswith",
separator : ",",
dataBound: function(e) {
var colDs = $("#collection_status").data("kendoAutoComplete").dataSource._data;
var colStatVal = $("#collection_status").val();
var colStatArr = colStatVal.split(",");
colStatArr.pop();
$.each(colStatArr, function(ind, val) {
if($.inArray(val, colDs) > -1){
colDs.splice(ind,1);
}
});
},
animation: {
open: {
effects: "fadeIn",
duration: 1,
show: true
}
}
});
But sometimes this code is showing the selected ones..How to correct this.Any help is much appreciated.