Problem in rendering Items after adding and removing values

2 posts, 0 answers
  1. eliraz
    eliraz avatar
    20 posts
    Member since:
    Nov 2010

    Posted 17 Jul 2013 Link to this post


    I'm trying to build a kendo window which includes both grid and multiselect controls, 
    and to allow by double clicking on a row in the grid to add the clicked item to the multi select (Lets say that "id is the value and "name" is the text).
    After clicking on the item in the grid I'm trying to append this new value  to the multi select using its api (using the "value" function).
    Afterwards,  I remove some of the values I've just added using the control itself (clicking on the "X" of the item) and adding the same items again.
    The initial dataSource of the multi select control is an empty array, while it's being changed when new values are added.
    I check if the new value I just got from the grid is already exists in the datasource and in the value array, otherwise I add it first to the datasource and then to the value array.

    When I made all the mentioned above, I found out that adding an item which had been removed before will hide/remove all the other items and the control would only display the last item added, while the value array still contains all the other ones.
    On the "change" event that is triggered by deleting this item, I watch at the value array and see that it's not been changed (this value is still there).
    Performing these steps over and over, the value list apears to have duplicates at the same amount as the selected items from the grid (distinct values).

  2. Petur Subev
    Petur Subev avatar
    1882 posts

    Posted 19 Jul 2013 Link to this post

    Hello Eliraz,

    I am not sure how your implementation goes since you did not share any code. However here is an example that I created from your explanation.

    It is working correctly on my side. I hope it helps.

    Petur Subev
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top