Removing items

3 posts, 0 answers
  1. Chris
    Chris avatar
    38 posts
    Member since:
    Feb 2012

    Posted 28 May 2012 Link to this post

    Hi,

    I've been racking my head around this one for a while and simply can't figure out how to do it.

    I've got a drop down list, and simply want to remove an item from it. I'm binding the drop down list in MVVM using the options binding to an array, which works fine.

    Now, whenever I try to remove an item from this array, MVVM should auto-bind the options to the Drop down list and update the items. This, however, is not the case. I've also tried calling .refresh() on the drop down list to no avail.

    I've tried doing this the jQuery way by removing individual li elements from the original <select> in my HTML, and then calling .refresh. This, again, does not work.

    Are there any ideas out there in how I can achieve this? .filter etc is not valid for my scenario, I want to do this via an array that isn't going back and forth from the server.
  2. Chris
    Chris avatar
    38 posts
    Member since:
    Feb 2012

    Posted 04 Jun 2012 Link to this post

    Bumping this - surely there has to be a way of removing items from a Kendo Dropdownlist?!
  3. Georgi Krustev
    Admin
    Georgi Krustev avatar
    3747 posts

    Posted 05 Jun 2012 Link to this post

    Hello Chris,

     
    You will need to remove the item and set the data of the DropDownList's dataSource. You can use the data method for this. Check this jsFiddle demo, which shows how to achieve this.

    Please note that we do not guarantee answers in the forums. I will suggest you open support threads for the next technical issues. Thus the support team will be able to help you faster.

    All the best,
    Georgi Krustev
    the Telerik team
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top