Please tell me how can we remove element from multi listview. When i am selecting any item it is giving me value but i am unable to remove selected elements.
PSB code:
var data = [
{ id: 1, text: "text 1" },
{ id: 2, text: "text 2" },
{ id: 3, text: "text 3" }
];
var d = $("#listview").kendoListView({
dataSource: data,
template: kendo.template($("#template").html()),
selectable: "multiple",
change: function() {
var index = this.select().index(),
dataItem = this.dataSource.view()[index];
//log("id: " + dataItem.id + ", text: " + dataItem.text);
var selected = $.map(this.select(), function(item) {
return data[$(item).index()].id;
});
//data.remove(selected);
//console.log(data);
console.log(selected);
//console.log("[" + selected.join(", ") + "]");
}
});
Please see jsfiddle : http://jsfiddle.net/AAMLA/179/
PSB code:
var data = [
{ id: 1, text: "text 1" },
{ id: 2, text: "text 2" },
{ id: 3, text: "text 3" }
];
var d = $("#listview").kendoListView({
dataSource: data,
template: kendo.template($("#template").html()),
selectable: "multiple",
change: function() {
var index = this.select().index(),
dataItem = this.dataSource.view()[index];
//log("id: " + dataItem.id + ", text: " + dataItem.text);
var selected = $.map(this.select(), function(item) {
return data[$(item).index()].id;
});
//data.remove(selected);
//console.log(data);
console.log(selected);
//console.log("[" + selected.join(", ") + "]");
}
});
Please see jsfiddle : http://jsfiddle.net/AAMLA/179/