or
var pagesize = $("#PageSizeSelect").data("kendoDropDownList").value(); alert("page size is now: " + pagesize); searchData.pageSize(parseInt(pagesize));// makes a second request - which works and has the new pagesize set // searchData is a kendo dataSource object searchData.read(searchBox);
var dataSourceStatistics = new kendo.data.DataSource({ batch: true, transport: { read: { data: { f:'getOrderSuggestion' } } }, schema: { data: function(data) { return data.result.custStats.Record; }, total: function(data) { return data.result.custStats.Record.length; }, model:{ // TODO: id should be EmployeeId id: "Employee", fields: { Employee: { }, EmployeeId: { }, ValueCultureAndExercise: { type: "number", defaultValue: "0", validation: { } }, ValueExercise: { type: "number", defaultValue: "0" }, Company: { editable: false, defaultValue: function() { return "apa"; } }, CompanyNo: { editable: false }, Department: { }, Total: function () { return this.ValueExercise * 10; } } } }});$("#orderGrid").kendoGrid({ dataSource: dataSourceStatistics, editable: { update: true, destroy: true }, sortable: true, selectable: true, toolbar: [{name: "create", text: "Lägg till rad"}], columns: [ { field: "Employee", title: "Namn" }, { field: "EmployeeId", title: "Anställningsnummer" }, { field: "ValueExercise", title: "Värde träning" }, { field: "ValueCultureAndExercise", title: "Värde träning och kultur" }, { field: "null", title: "Totalt", template: "#= ValueCultureAndExercise + ValueExercise#" }, { command: "destroy", title: "Ta bort" } ]});