This is a migrated thread and some comments may be shown as answers.

remove items from datasource not appear on combobox

1 Answer 574 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Nadav
Top achievements
Rank 1
Nadav asked on 16 May 2017, 08:54 AM

Hi all,

I am successfully load datasource data from server and then i remove some items from the datasource then i bind it to the combobox. the problems is that the removed data still appear? 

 

// data from server works fine

comboData: kendo.data.DataSource = new kendo.data.DataSource({
transport: {
read: {
dataType: "jsonp",
url: `my url`
}
}
});

 

//combobox binding

this.comboBox = $("#elementid").kendoComboBox({
dataTextField: "DisplayName",
dataValueField: "SchemaName",
select: (e) => this.onSelectionChanged(e),
dataSource: this.comboData
}).data("kendoComboBox").focus();
$("#elementid").data("kendoComboBox").open();

 

// remove data from datasource

var rawData:any = this.comboData.data();

for(let dataItem of rawData){
if(my condition ) {
this.comboData.remove(dataItem);
}
}

1 Answer, 1 is accepted

Sort by
0
Ivan Danchev
Telerik team
answered on 18 May 2017, 08:44 AM
Hello Nadav,

Here's a sample dojo, which demonstrates how you can remove all the items from the dataSource or a specific item based on a condition (in the example the item with text "Chang").

Regards,
Ivan Danchev
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
ComboBox
Asked by
Nadav
Top achievements
Rank 1
Answers by
Ivan Danchev
Telerik team
Share this question
or