Good afternoon guys, I have the following error:
Uncaught TypeError: Can not read property 'pageSize' of undefined.
I'm working with Kendo UI, trying to generate a list of users, using kendoDropDownList
, but I still can not understand the operation of this part of the system. I will leave here my two codes, both JavaScript and HTML, and if anyone can help me I will thank you very much.
JS code example:
$(document).ready(function() {
$("#orders").kendoDropDownList({
template: '<span class="order-id">#= OrderID #</span> #= ShipName #, #= ShipCountry #',
dataTextField: "userName",
dataValueField: "userId",
filter: "contains",
virtual: {
itemHeight: 26,
valueMapper: function(options) {
$.ajax({
url: "./db/getListUsers",
type: "GET",
dataType: "json",
data: convertValues(options.data.pageSize,options.data.page),
success: function (data,textStatus,jqXHR) { option.success(data,textStatus,jqXHR) },
error: function (jqXHR,textStatus,errorThrown) { option.error(jqXHR,textStatus,errorThrown)}
})
}
},
height: 290,
dataSource: {
type: "data",
transport: {
read: "./db/getListUsers"
},
schema: {
model: {
fields: {
data: "users",
total: "total"
}
}
},
pageSize: 10,
serverPaging: true,
serverSorting: false,
serverFiltering: false
}
});
});
function convertValues(value) {
var data = {};
value = $.isArray(value) ? value : [value];
for (var idx = 0; idx < value.length; idx++) {
data["values[" + idx + "]"] = value[idx];
}
return data;
}
Example of JSP code:
<div>
<div class="demo-section k-content">
<h4 style="color:#ddd;"><spring:message code="imexp.ucases.groups.list_users"/></h4>
<input id="orders" style="width: 20%;" />
</div>
</div>