This is a migrated thread and some comments may be shown as answers.
Remove/Add
3 Answers 24 Views
This is a migrated thread and some comments may be shown as answers.
Voss
Top achievements
Rank 1
Voss asked on 15 Aug 2014, 06:08 PM
I've seen some similar posts, but not exactly what I need.

I have two ListViews

Items can be dragged and dropped between them.

I need to be able to remove the dragged item from one list and add it to the other list.

This is how the ListView is created.

<div id="serversAll">
            <div data-role="scroller" style="background-color: gray; height: 300px; width: 370px; padding-top: 13px; padding-bottom: 17px;">
                <table data-bind="source: serversAll" data-template="templateServers" class="servers"></table>
            </div>
        </div>

var vmSevers = kendo.observable({
       isVisible: true,
       serversAll: new kendo.data.DataSource({
           schema: {
               model: {
                   id: "Id"
               }
           },
           batch: false,
           transport: {
               read: {
                   url: url
               }
           }
       })
   });

   kendo.bind($("#serversAll"), vmSevers, kendo.mobile.ui);

3 Answers, 1 is accepted

Sort by
0
Alexander Valchev
Telerik team
answered on 19 Aug 2014, 08:48 AM
Hi Voss,

Please check this help topic as it explains how to achieve such scenario using Kendo Drag & Drop events and DataSource API

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Voss
Top achievements
Rank 1
answered on 19 Aug 2014, 06:14 PM
I can't get the:
dataItem = listA_DS.getByUid(draggableElement.data("uid"));

to work on my example. Your sample works in the dojo. Is there something I need to do extra to generate the uid?

thanks.
0
Accepted
Alexander Valchev
Telerik team
answered on 20 Aug 2014, 11:14 AM
Hello Voss,

The DataSource automatically generates uid for every record. You should manually add it in the template (templateServers).

<script type="text/x-kendo-template" id="templateServers">
  <tr data-uid="#:uid#">
    (...)
  </tr>
</script>


Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Asked by
Voss
Top achievements
Rank 1
Answers by
Alexander Valchev
Telerik team
Voss
Top achievements
Rank 1
Share this question
or