Selectable ListView binded to a DataSource looses selection on data change

5 posts, 0 answers
  1. rlapao
    rlapao avatar
    23 posts
    Member since:
    Oct 2006

    Posted 27 Apr 2012 Link to this post

    Hi,

    I'm I have created an example that illustrates my problem: http://jsfiddle.net/tcTRy/11/

    I believe that this is the expected behavior, but is there a workaround to don't loose selection?

    In my case I have a listview that when is selected show some details, and some of the details causes the list view datasource data to change. For instace if I edit the Title this will update the Title in the listview, although it would be nice to don't loose the selection, or else the details will be hidden.

    Any ideas?

    Thanks,
    Ricardo
  2. Kevin
    Kevin avatar
    5 posts
    Member since:
    May 2012

    Posted 10 Aug 2012 Link to this post

    +1 same issue here.

    I have a datasource for my listview. The objects of the datasource having a property called "data". The data property isnt shown in the listview so it wouldnt be necessary to refresh the list everytime the data property changed. Is there a way to prevent the list from refreshing (and deselecting)? In my case the data proeprty is an array and I add items to this array almost the whole time.
  3. Kendo UI is VS 2017 Ready
  4. Kevin
    Kevin avatar
    5 posts
    Member since:
    May 2012

    Posted 14 Aug 2012 Link to this post

    Seems like the problem is solved with the latest release.
  5. Eric
    Eric avatar
    2 posts
    Member since:
    Nov 2010

    Posted 19 Aug 2013 Link to this post

    As of version 2013.2.716 this still appears to be the behavior. If you have the selected item bound and make changes to it while selected, the item deselects from the list. Is this the intended behavior or a bug?

    -Eric
  6. Kiril Nikolov
    Admin
    Kiril Nikolov avatar
    2565 posts

    Posted 22 Aug 2013 Link to this post

    Hello Guys,

    When an item is changed in the Kendo UI ListView, only the current item is redrawn and not the whole ListView. So saving the selected element (or its uid), will make it possible to select the element that was selected prior the change. Then you can use the itemChanged event (fired after the element is updated) to select the same element by the uid(which remains the same).

    I have prepared a short example showing a possible implementation:

    http://jsbin.com/OTEmOle/1/edit
     
    Regards,
    Kiril Nikolov
    Telerik
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Back to Top
Kendo UI is VS 2017 Ready