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

Listbox with template and MVVM - not data displayed when item moved

1 Answer 188 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
Francis
Top achievements
Rank 1
Francis asked on 04 Aug 2017, 07:07 PM

I implemented two listboxes with drag-drop enabled. The listboxes use a template to displayed their items.

When I drag or move an item with the toolbar to the second listbox, the item is moved but the data is not displayed. My template must be OK because when I load the view the first time, the items are correctly displayed in the listboxes. Also, if I send the binding information, I received the correct information with the dragged items in the second listboxes so it is only a displaying issue that I cant figure out.

You can see the problem in the html in attachment. Try to drag an item to one listbox to another.

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 08 Aug 2017, 08:52 AM
Hello Francis,

Thank you for the provided example.

After additional investigation and consulting with the developer's team, I can confirm that this is expected because the template is not automatically rebound after drag and drop. In this scenario I can suggest manually refreshing the second ListBoxt on the dragend event of the first ListBox:

http://docs.telerik.com/kendo-ui/api/javascript/ui/listbox#events-dragend

Also, both ListBox widgets have to be bound to a dataSource instance.

I modify the example to demonstrate this:

http://dojo.telerik.com/asOfa

Similar logic may need to be added to the add event(with timeout) if the arrows from the toolbar will be used:

http://docs.telerik.com/kendo-ui/api/javascript/ui/listbox#events-add

I hope this is helpful.

Regards,
Stefan
Progress Telerik
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
ListBox
Asked by
Francis
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or