service.getData(tempSkip, $scope.queuePageSize).success(function (data, status, headers, config) { $scope.messages = data; $scope.showCaption = false; $scope.loadingMessages = false;}).error(function (data, status, headers, config) { $scope.workingText = 'Oh CRUD ! Change a few things up and try again.'; console.log('error getting messages'); $scope.loadingMessages = false;});(function () { 'use strict'; angular .module('app') .service('messageQueueService', ['$http', messageQueueService]); function messageQueueService($http) { var baseUrl = rootUrl + 'api/MessageQueue/'; this.getData = getData; function getData(skip, take) { return $http({ url: baseUrl + 'Get', params: { val1: skip, val2: take }, method: 'GET' }); }}})();(function () { 'use strict'; angular .module('app') .factory('messageQueueKendoDsService', ['$http', messageQueueKendoDsService]); function messageQueueKendoDsService($http) { var baseUrl = rootUrl + 'api/MessageQueue/'; var knedoDataSource = new kendo.data.DataSource({ transport: { read: { async: false, url: baseUrl + 'Get', dataType: 'json' } }, batch: false, serverPaging: true, serverSorting: true, serverFiltering: true, schema: { model: { id: 'Id', fields: { parentId: { field: 'FenergoMessageId', nullable: true }, Id: { field: 'Id', type: 'number'} } } } }); return knedoDataSource; }})();$scope.treelistOptions = { dataSource: messageQueueDataSource, sortable: true, columns: [ { field: 'Id', title: 'Message ID' }, { field: 'FenergoMessageId', title: 'Fenergo ID' } ]};<div> <div data-kendo-treelist="" data-options="treelistOptions"></div></div>
I've found a small bug in the grid which has an impact on sorting.
To reproduce this issue, execute the following:
Create a grid that allows SingleColumn sorting. DO NOT SET the following:
JavaScript
sortable: { mode: 'single' }
If configured like above, you won't be able to reproduce the bug.
It should be configured the following way:
JavaScript
sortable: true
If you configure the Grid with the MVC HtmlHelper (.Sortable(a => a.SortMode(GridSortMode.SingleColumn)), you will get the sortable: true as Javascript output.
- Enable the column menu
- Sort a column
- Sort another column by using the column menu (use the small arrow).
You have now achieved multi-column sorting while only a single column should be able to be sorted (default value of sortable is single!​).​
If you have server side sorting on, you will notice you will receive 2 objects in the sorts object.
$(document).ready(function () { var grid = $("#grid").kendoGrid({ dataSource: { dataType: 'json', transport: { read: { url: '/remoteurl', dataType: 'json', data: { resultid: 'report_myprojects' } } }, schema: { data: 'results', total: 'total', groups: 'groups', aggregates: 'aggregates' }, pageSize: 20, serverPaging: true, serverGrouping: true, serverFiltering: true, serverSorting: true }, groupable: true, sortable: true, pageable: { refresh: true, pageSizes: [10, 20, 50, 100], buttonCount: 5 }, columns: [{ field: "fld_1001", title: "Aangemaakt op", groupHeaderTemplate1: "Created: #=value# (Count: #=count#) #saveCurrentAggregate(data)#", ,groupFooterTemplate: "Total: #=getCurrentAggregate()#" }, { field: "pro1", title: "Status", groupHeaderTemplate: "Status: #=value# (Count: #=count#) #saveCurrentAggregate(data)#", }, { field: "fld_1000", title: "Created by", groupHeaderTemplate: "Created by: #=value# (Count: #=count#) #saveCurrentAggregate(data)#", }, { field: "flddef_1", title: "Project", groupHeaderTemplate: "Project: #=value# (Count: #=count#) #saveCurrentAggregate(data)#", }, { field: "flddef_2", title: "Project lead" groupHeaderTemplate: "Project lead: #=value# (Count: #=count#) #saveCurrentAggregate(data)#", }, { field: "flddef_21", title: "Start" groupHeaderTemplate: "Start: #=value# (Count: #=count#) #saveCurrentAggregate(data)#", } ] });}); var cur_aggregate; function saveCurrentAggregate(data) { cur_aggregate = data.count;} function getCurrentAggregate() { return cur_aggregate;}