Select items in one ListView, add to another ListView?

2 posts, 0 answers
  1. Eddie
    Eddie avatar
    66 posts
    Member since:
    May 2008

    Posted 08 Oct 2014 Link to this post

    I've got an application where I need to present a list of photos, and allow the user to select photos, which are then added to a second list (list 2), which is above the original list (list 1).  When list 2 contains 6 items, another action should happen.  I'm wondering if the kendo ListView can accomplish this design requirement?  

    I'm struggling a bit with figuring out how to select items in the listview without deselecting all other items - is that possible, and if so, how?  Another requirement is that if the user selects an item, then clicks it again, it should be removed from list 2, and deselected in list 1.  In other words, one click selects an item in the list, a second click on that same item deselects it.  I do have selectable set to 'multiple'.

    Does the listview's 'change' event trigger when an item is added to the listview, or just if an item is clicked in the listview?  If the latter, is there an event that will notify me if an item is added to the listview, or do I handle that in the dataSource?

    Finally, I would like to provide a default image for the six items in list 2, which would be replaced when those items are populated by selected items in list 1.  See the attached screenshot for an example.  I can't figure out how to use the template system to accomplish this.  I haven't used the drag and drop controls before, perhaps those would be a better candidate for this implementation? 

    Ideally there's an example out there somewhere I can look at to see how this is done, but any help is appreciated.

    Thanks!
  2. Alexander Valchev
    Admin
    Alexander Valchev avatar
    2875 posts

    Posted 10 Oct 2014 Link to this post

    Hello Eddie,

    The scenario you described is not supported by the build-in selectable feature however you may easy configure it by using the jQuery and DataSource API methods.
    Please check the following example: http://dojo.telerik.com/edeTA

    Does the listview's 'change' event trigger when an item is added to the listview, or just if an item is clicked in the listview?  If the latter, is there an event that will notify me if an item is added to the listview, or do I handle that in the dataSource?

    ListView change event is fired only when the build-in selection changes (the example above does not use the build-in selection). DataSource change event is fired when an item is added to the DataSource.

    Finally, I would like to provide a default image for the six items in list 2, which would be replaced when those items are populated by selected items in list. I can't figure out how to use the template system to accomplish this. I haven't used the drag and drop controls before, perhaps those would be a better candidate for this implementation?

    In order to assist you with this question I will need the template code and how your data looks like. Could you please modify the test page that I provided above so I can examine your implementation and advise you accordingly?

    Regards,
    Alexander Valchev
    Telerik
     
    Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
     
  3. Kendo UI is VS 2017 Ready
Back to Top