kendo 服务端排序

z折腾了一天。。

参考 :https://docs.telerik.com/kendo-ui/api/javascript/ui/grid#configuration-columns.sortable.compare

关键代码

		parameterMap: function(data, type) {
						if(data.sort) {
							var sortObj = data.sort[0];
							typeSort = sortObj.dir;
							typeName = sortObj.field;
							switch(typeName) {
								case 'gongBuRi':
									typeName = 'GONG_BU_RI';
									break;
								case 'gongGaoBT':
									typeName = 'GONGGAO_BT';
									break;
							}
							//							data.orderByType = typeSort;
							//							data.orderBy = typeName;
							data.sort[0] = {};
							data.orderByType = typeSort;
							data.orderBy = typeName;
						}
						return data;
						// if type is "read", then data is { foo: 1 }, we also want to add { "bar": 2 }

					}

				serverPaging: true,
                   serverSorting: true,

  欢迎交流学习

posted @ 2017-10-08 16:56  徐弘历  阅读(909)  评论(0编辑  收藏  举报