I have a Kendo ListView, which I have selected set to "multiple". I also have a button on that page that will do data processing. Part of it's function is to get the selected items from that ListView and put them into some type of array. However I can't even accessthe bloody selected items from the ListView.
With Telerik's PATHETIC support for Angular I have to resort to jQuery, but even with that older code I still can't get a list of selected items from the ListView.
Obligatory code sections that proably won't make sense to anybody, but need to be included otherwise support will whine about not having code to review.
HTML:
<
fieldset
class
=
"bsFilterSetGreyBk bsFullHeight"
>
<
legend
class
=
"bsLegend"
>Available To Assign</
legend
>
<
div
kendo-listview
id
=
"unAssignedListView"
k-data-source
=
"camu.mUnassigned"
k-options
=
"camu.klvOptions"
></
div
>
<
div
kendo-pager
id
=
"unAssignedPager"
k-data-source
=
"camu.mUnassigned"
></
div
>
</
fieldset
>
Angular Controller:
(function() {
"use strict";
angular
.module("controller.assignUser", ["ngAnimate", "ngMessages", "ngSanitize", "kendo.directives"])
.controller("ctrlAssignUser",
[
"$window",
"appSettings",
"assignToUser",
function ($window, appSettings, assignToUser) {
var camu = this;
camu.lstSelection = null;
camu.selId = null;
camu.auOptions = {
optionLabel: "Click Here to choose user...",
dataTextField: "user",
dataValueField: "id",
dataSource: {
transport: {
type: "jsonp",
read: {
url: appSettings.serverPath + "/api/assign/allusers/"
}
}
}
};
camu.klvOptions = {
selectable: "multiple",
template: "<
div
class
=
'klvItems'
>#= oldMeterNumber#</
div
>"
}
camu.addMtr = function() {
var list = $("#unAssignedListView").data("kendoListView");
//Resorting to jQueary because of... reasons! List is test variable that I can't get the selected data into.
};
camu.changeAssUser = function () {
if (camu.selId === "") {
camu.selId = null;
return;
}
camu.mUnassigned = new kendo.data.DataSource({
transport: {
type: "jsonp",
read: function(options) {
assignToUser.getUnassigned.query(
null,
function(data) {
options.success(data);
});
}
},
pageSize: camu.getListViewRows()
});
camu.mAssignUser = new kendo.data.DataSource({
transport: {
type: "jsonp",
read: function (options) {
assignToUser.getAssigned.query(
{ "userId": camu.selId },
function(data) {
options.success(data);
});
}
},
pageSize: camu.getListViewRows()
});
}
camu.getListViewRows = function () {
return Math.floor(($window.innerHeight - appSettings.windowChrome) / appSettings.rowHeightPx);
};
camu.getPageHeight = function () {
return { height: ($window.innerHeight - appSettings.navbarHeight) + "px" };
};
}
]);
}());
So what am I doing wrong?