如何在Kendo Grid UI中同时重新排序行和滚动



我已经使用kendo排序来拖动行以重新排序。

javaScript:

grid.table.kendoSortable({
        filter: ">tbody >tr",
        hint: function (element) { 
            var table = $('<table style="width: 600px;" class="k-grid k-widget"></table>'),
                hint;
            table.append(element.clone()); 
            table.css("opacity", 0.7);
            return table; 
        },
        cursor: "move",
        placeholder: function (element) {
            return $('<tr colspan="4" class="placeholder"></tr>');
        }
        ,
        change: function (e) {
            var skip = grid.dataSource.skip(),
                oldIndex = e.oldIndex ,
                newIndex = e.newIndex ,
                data = grid.dataSource.data(),
                dataItem = grid.dataSource.getByUid(e.item.data("uid"));
            grid.dataSource.remove(dataItem);
            grid.dataSource.insert(newIndex, dataItem);
        }
    });

我不能同时滚动和拖动。在拖动时滚动到工作。如何解决它?

去年左右,他们添加了一个新设置:autoScroll可以解决问题。请参阅https://docs.telerik.com/kendo-ui/api/javascript/ui/sortable/configuration/autoscroll for document。

最新更新