remove items from datasource not appear on combobox

2 posts, 0 answers
  1. Nadav
    Nadav avatar
    5 posts
    Member since:
    Mar 2017

    Posted 16 May Link to this post

    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);
    }
    }

  2. Ivan Danchev
    Admin
    Ivan Danchev avatar
    1268 posts

    Posted 18 May Link to this post

    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.
Back to Top