This is a migrated thread and some comments may be shown as answers.

Select items in one ListView, add to another ListView?

1 Answer 294 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Software
Top achievements
Rank 1
Software asked on 08 Oct 2014, 05:54 PM
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!

1 Answer, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 10 Oct 2014, 11:16 AM
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!
 
Tags
ListView
Asked by
Software
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Share this question
or