I have a templated list:
<script type="text/x-kendo-tmpl" id="xts-contents-detail-template">
<div id='contents-list-sortable' data-role="listview sortable" data-template="xts-content-item-template" data-selectable="single"
data-bind="source: contentDataSource">
</div>
</script>
<script type="text/x-kendo-tmpl" id="xts-content-item-template">
<div>
<hr>
<h5> <span data-bind='text: name'> </span> </h5>
<span data-bind='text: description'> </span>
</div>
</script>
Which later gets populated in Javascript:
this.pObservableContent = kendo.observable({
contentDataSource: new kendo.data.DataSource({
data: [],
}),
});
let listView = new kendo.View('#xts-contents-detail-template', {
model: this.pObservableContent,
});
// put the list somewhere
let listHtml = listView.render();
this.pView.element.find('.contents-list').html(listHtml);
// make the list sortable
// this.pView.element.find('#contents-list-sortable').kendoSortable({
$('#contents-list-sortable').kendoSortable({
});
Also, some content gets added later on:
this.pObservableContent.contentDataSource.data(this.pReportDefinition.contents);
The user may then re-order the list.
this.pObservableContent.contentDataSource.data() does not reflect the user selected order. How do I know what the new order is?