I've got a listview that is backed with a remote datasource.
I want the datasource to be ordered by the client so that new items added are automatically placed in the correct place (total number of items will not be that many).
If I order the items using in 'asc', then triggering listview.add() works as expected, however if I reverse the direction so it's 'desc', then listview.add() results in it editing the last item in the list instead.
Example posted here http://dojo.telerik.com/iMArI
$("#listView").kendoListView({
dataSource: {
data: [
{ name: "A Doe" },
{ name: "B Doe" },
{ name: "C Doe" },
{ name: "D Doe" },
{ name: "E Doe" }
],
sort: [{ field: 'name', dir: 'desc' }]
},
template: "<
div
>#:name#</
div
>",
editTemplate: '<
div
><
input
type
=
"text"
name
=
"name"
data-bind
=
"value:name"
/></
div
>'
});
// get a reference to the list view widget
var listView = $("#listView").data("kendoListView");
// add item
listView.add();
Kind regards,
Greg