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