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

When kendodraggable is enabled, the cell value can not be set on the grid

2 Answers 95 Views
Grid
This is a migrated thread and some comments may be shown as answers.
JiaQing
Top achievements
Rank 1
JiaQing asked on 07 Dec 2017, 08:58 AM

When kendodraggable is enabled, the cell value can not be set on the grid

http://dojo.telerik.com/eRaxeQ

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>Kendo UI Snippet</title>
 
 
    <script src="https://code.jquery.com/jquery-1.12.3.min.js"></script>
</head>
<body>
<div id="grid"/>
    <script>
     var data = [
    { id: 1, text: "text 1", position: 0 },
    { id: 2, text: "text 2", position: 1 },
    { id: 3, text: "text 3", position: 2 }
]
 
var dataSource = new kendo.data.DataSource({
        data: data,       
        schema: {
            model: {
                id: "id",
                fields: {
                    id: { type: "number" },
                    text: { type: "string" },
                    position: { type: "number" }
                }
            }
        }
    });
 
var grid = $("#grid").kendoGrid({
    dataSource: dataSource,
    sortable: true,
    scrollable: false,   
    editable: true,
    columns: ["id", "text", "position"]           
}).data("kendoGrid");
 
grid.table.kendoDraggable({
    filter: "tbody > tr",
    group: "gridGroup",
    threshold: 10011,
    drag: function(e) {
      $(e.target).closest("tbody").find("tr").css("background-color", "white");
       $(e.target).closest("tr").css("background-color", "red");
    },
    hint: function(e) {
        return $('<div class="k-grid k-widget"><table><tbody><tr>' + e.html() + '</tr></tbody></table></div>');
    }
});
 
    </script>
</body>
</html>

2 Answers, 1 is accepted

Sort by
0
Accepted
Tsvetina
Telerik team
answered on 08 Dec 2017, 05:49 PM
Hello JiaQing,

The same limitation as the one described for the Sortable widget applies for the Draggable, too:
Grid in Batch Editing Mode

The article contains explanation of the problem and an example, which shows how to create custom editors in the Grid that will work when the Draggable/Sortable widget is initialized.

Regards,
Tsvetina
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
JiaQing
Top achievements
Rank 1
answered on 11 Dec 2017, 04:58 AM
Thank you for all your assistance
Tags
Grid
Asked by
JiaQing
Top achievements
Rank 1
Answers by
Tsvetina
Telerik team
JiaQing
Top achievements
Rank 1
Share this question
or