Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/411.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 使用KENDO Dragable拖动KENDO UI Listview的单个元素_Javascript_Html_Kendo Ui - Fatal编程技术网

Javascript 使用KENDO Dragable拖动KENDO UI Listview的单个元素

Javascript 使用KENDO Dragable拖动KENDO UI Listview的单个元素,javascript,html,kendo-ui,Javascript,Html,Kendo Ui,下面是每个列表项的模板代码。我只希望在拖动时选择特定的列表项。现在,整个列表视图本身被选中。我应该对我的可拖动剑道源应用什么过滤器 <script type="text/x-kendo-tmpl" id="template"> <div class="DeviceList" id="draggable"> #:Name#<br/> #:HDate#<br/> #:IsAnnual#<b

下面是每个列表项的模板代码。我只希望在拖动时选择特定的列表项。现在,整个列表视图本身被选中。我应该对我的可拖动剑道源应用什么过滤器

<script type="text/x-kendo-tmpl" id="template">
    <div class="DeviceList" id="draggable"> 
        #:Name#<br/>
        #:HDate#<br/>
        #:IsAnnual#<br/>
        #:Type#<br/>
        </div>
</script>

#:Name#
#:HDate#
#:IsAnnual#
#:键入#
下面是我的剑道列表视图初始化调用:

 var list =   $("#listView").kendoListView({
            autoBind: true,
            dataBound: function (e) {
                if (dataSource.total() == 0) {
                    $("#listView").html('<tr><td>There are no members at this time.</td></tr>');
                };
            },
            dataSource: dataSource,
            selectable: "single",
            template: kendo.template($("#template").html()),
            change: function (e) {
                var index = this.select().index();
                var dataItem = this.dataSource.at(index); 
            }

      });
 list.kendoDraggable({

          hint: function (row) {
              return row.clone();  //returns the same mark up as the template <li>some name</li>
          }
      });
var list=$(“#列表视图”).kendoListView({
自动绑定:是的,
数据绑定:函数(e){
if(dataSource.total()==0){
$(“#listView”).html('目前没有成员');
};
},
数据源:数据源,
可选:“单一”,
模板:kendo.template($(“#template”).html(),
更改:功能(e){
var index=this.select().index();
var dataItem=this.dataSource.at(索引);
}
});
list.kendoDraggable({
提示:函数(行){
return row.clone();//返回与模板
  • 某个名称相同的标记
  • } });
    您应该执行以下操作:

    list.kendoDraggable({
        filter: ".DeviceList",
        hint  : function (row) {
            return row.clone();  //returns the same mark up as the template <li>some name</li>
        }
    });
    
    list.kendoDraggable({
    过滤器:“.DeviceList”,
    提示:函数(行){
    return row.clone();//返回与模板
  • 某个名称相同的标记
  • } });
    利用为每个项目设置一个类
    DeviceList