下面是我的每个列表项的模板代码。我只想在拖动时选择特定的列表项。现在整个列表视图本身被选中。我应该对我的可拖动剑道源应用什么过滤器?
<script type="text/x-kendo-tmpl" id="template">
<div class="DeviceList" id="draggable">
#:Name#<br/>
#:HDate#<br/>
#:IsAnnual#<br/>
#:Type#<br/>
</div>
</script>
下面是我的剑道列表视图初始化调用:
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>
}
});