DataSource MVVM Filter Remove Errors

3 posts, 0 answers
  1. ISEEUGlobal
    ISEEUGlobal avatar
    5 posts
    Member since:
    Apr 2014

    Posted 05 Aug 2015 Link to this post

    The title for this issue is difficult to describe. Basically here is what we are doing.

    1. Using MVVM to bind two search boxes that filter data in a The filtering is by setting simple filters on the data source

    2. The dataSource is bound to a table (not grid)

    3. Each row contains a remove button

    With no filters in place the remove operation works correctly. However with any filter applied I can only remove the first item in the list. However it is actually removing the first item in the datasource regardless of the filters, any other items cause an error 'Cannot read property 'kendoBindingTarget' of undefined'. Its hard to understand but if you checkout this jsfiddle

     I have simulated a very cut down​ version of the trial. Basically to use try filter by one or both of the options. (Min 3 characters before filter), once filtered try and remove items. Place close attention to the 'Id' column that you remove as you will see that it actually wont remove the item you selected unless the item selected is id 1 (the first item in the data source).

    Any help would be greatly appreciated.

  2. Alexander Popov
    Alexander Popov avatar
    1411 posts

    Posted 10 Aug 2015 Link to this post


    It seems that the binder cannot find the correct HTML element which should be removed, as it relies on the index of the underlying data item. When filter is applied however, the index of the data item no longer corresponds to the HTML element, hence the error. I have logged this issue in our GitHub repository, so you can track its status. Meanwhile, you can use a Grid as a workaround.

    As a small sign of our appreciation for bringing this to our attention I have updated your Telerik points.

    Alexander Popov
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
  3. ISEEUGlobal
    ISEEUGlobal avatar
    5 posts
    Member since:
    Apr 2014

    Posted 13 Aug 2015 Link to this post


     Thank you for reviewing this, I have been forced down the route to reload the data source through an Ajax Request for the filtering. Obviously if I have the data already loaded on the client it is a waste of resources to refetch the same data. One thing I did try was manually filtering the data and rebinding the table.

     I appreciate your review and wish it was something I was doing wrong. Thank you again.


Back to Top