首页 > 解决方案 > Kendo UI Sortable Connect With 不起作用

问题描述

我有两个可排序的列表。我想连接这个列表,这样我就可以在两个方向上将项目从一个列表移动到另一个列表。我使用可排序的 connectWith,但我仍然无法将列表项从一个列表移动到另一个列表。

这是代码:

<div class="k-card">
            <div class="k-card-header">
                <h5 class="k-card-title">No Doctors in Visit</h5>
            </div>
            <div class="k-card-body" style="overflow: auto;">
                <div class="Leftlst">
                    <p class="ListTitle LeftTitle">Detailable</p>
                    @(Html.Kendo().ListView<ProductViewModel>()
                        .Name("Left_lstVw_0")
                        .TagName("div")
                        .ClientTemplateId("ProductLsttemplate")
                        .HtmlAttributes(new { @class = "ListViewClass" })
                        .DataSource(dataSource =>
                        {
                            dataSource.Read(read => read.Action("LftLstProduct_Read", "RepTeam", new 
                             { SpecialityID = 0, TeamID = Model.RepTeamID, PeriodID = currentPeriod, CustomerID = 0 }));

                        }))
                </div>
                <div class="Rightlst">
                    <p class="ListTitle rightTitle">Non-Detailable</p>
                    @(Html.Kendo().ListView<ProductViewModel>()
                        .Name("Right_lstVw_0")
                        .TagName("div")
                        .ClientTemplateId("ProductLsttemplate")
                        .HtmlAttributes(new { @class = "ListViewClass" })
                        .DataSource(dataSource =>
                        {
                            dataSource.Read(read => read.Action("RightLstProduct_Read", "RepTeam", new { SpecialityID = 0, TeamID = Model.RepTeamID, PeriodID = currentPeriod, CustomerID = 0 }));
                        }))
                </div>



               
                    @(Html.Kendo().Sortable()
                    .For("#Left_lstVw_0")
                    //.Events(e => e.Change("lftlstChange"))
                    .Filter(".k-listview-content > div.product")
                    .ConnectWith("#Right_lstVw_0")
                    .PlaceholderHandler("placeholder")
                    .HintHandler("hint")
                    .Cursor("move")

                    )

                    @(Html.Kendo().Sortable()
                    .For("#Right_lstVw_0")
                    .Filter(".k-listview-content > div.product")
                    //.Events(e => e.Change("rghtlstChange").End("rghtlstEnd"))
                    .ConnectWith("#Left_lstVw_0")
                    .PlaceholderHandler("placeholder")
                    .HintHandler("hint")
                    .Cursor("move")
                    )
                <script>
                function placeholder(element) {
    return element.clone().css("opacity", 0.1);
}

function hint(element) {
    return element.clone().removeClass("k-state-selected");
}
             </script>
            </div>
        </div>

我无法找出问题所在。

有人能帮我吗?

谢谢

标签: htmlkendo-ui

解决方案


推荐阅读