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

3 posts, 1 answers
  1. JiaQing
    JiaQing avatar
    2 posts
    Member since:
    Dec 2017

    Posted 07 Dec 2017 Link to this post

    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. Answer
    Tsvetina
    Admin
    Tsvetina avatar
    2481 posts

    Posted 08 Dec 2017 Link to this post

    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.
  3. JiaQing
    JiaQing avatar
    2 posts
    Member since:
    Dec 2017

    Posted 10 Dec 2017 in reply to Tsvetina Link to this post

    Thank you for all your assistance
Back to Top