Why I can't sort of more column, and this can be a single?
code:
var grid= $("#grid").kendoGrid({
dataSource: {
transport: {
read:{
url: "contract/list",
dataType:"json"
}
},schema: {
model: {
fields: {
num: { type: "string" },
proj: { type: "string" },
type: { type: "string" },
amount: { type: "number" },
paid: { type: "number" },
unpaid: { type: "number" },
bl: { type: "number" }
}
}
},
pageSize: 20
// serverPaging: true,
// serverFiltering: true,
// serverSorting: true
},
selectable: "row",
// change: onChange,
change: onChange,
dataBound: function(e) {
if(this.dataSource.group().length == 0) {
//changes the text of the grouping template
setTimeout( function() {
$(".k-grouping-header").html("拖动列到此进行数据分组");
// $(".k-toolbar.k-grid-toolbar").append("<span id='customMessage'>New or changed data are not stored - Please save data.</span>");
});
}
// var grid = $("#grid").data("kendoGrid");
// grid.tbody.find("tr:gt(0)").find(" td:eq(1)").css(tr_sl);
// grid.tbody.find("td:eq(1)").css('background','#F00');
// var x= grid.tbody.find("tr:gt(0)").find(" td:eq(7)").text();
// alert(x)
// if(x<=0){
// x.css('background','#F00')
// }
// alert(x);
},
columns: [
// { title: "aaaa", field: "num", width: 130,template:inlineTemplate},
{ title: "bbbb", field: "num", width: 130},
{ title: "cccc", field: "proj",width: 60},
{ title: "dddd", field: "type",width: 50},
{ title: "eeee", field: "amount",width: 70},
{ title: "ffff", field: "paid",width: 70},
{ title: "gggg", field: "unpaid",width: 80},
{ title: "hhhh", field: "bl",width: 50}
],
filterable: {
name: "FilterMenu",
extra: true, // turns on/off the second filter option
messages: {
info: "数据筛选选项", // sets the text on top of the filter menu
filter: "执行筛选", // sets the text for the "Filter" button
clear: "取消筛选", // sets the text for the "Clear" button
// when filtering boolean numbers
isTrue: "是", // sets the text for "isTrue" radio button
isFalse: "否" // sets the text for "isFalse" radio button
},
operators: {
//filter menu for "string" type columns
string: {
eq: "等于",
neq: "不等于",
startswith: "指定内容开头",
contains: "内容包括",
endswith: "指定内容结尾"
},
//filter menu for "number" type columns
number: {
eq: "等于",
neq: "不等于",
gte: "大于等于",
gt: "大于",
lte: "小于等于",
lt: "小于"
},
//filter menu for "date" type columns
date: {
eq: "等于",
neq: "不等于",
gte: "大于等于",
gt: "大于",
lte: "小于等于",
lt: "小于"
}
}
},
// toolbar: kendo.template($("#template").html()),
height: h,
groupable: true,
scrollable: true,
sortable: {
mode: "multiple",
allowUnsort: true
},
sortable: true,
sortable: {
mode: "multiple",
allowUnsort: true
},
pageable: true
filterable: true
}).data("kendoGrid");
code:
var grid= $("#grid").kendoGrid({
dataSource: {
transport: {
read:{
url: "contract/list",
dataType:"json"
}
},schema: {
model: {
fields: {
num: { type: "string" },
proj: { type: "string" },
type: { type: "string" },
amount: { type: "number" },
paid: { type: "number" },
unpaid: { type: "number" },
bl: { type: "number" }
}
}
},
pageSize: 20
// serverPaging: true,
// serverFiltering: true,
// serverSorting: true
},
selectable: "row",
// change: onChange,
change: onChange,
dataBound: function(e) {
if(this.dataSource.group().length == 0) {
//changes the text of the grouping template
setTimeout( function() {
$(".k-grouping-header").html("拖动列到此进行数据分组");
// $(".k-toolbar.k-grid-toolbar").append("<span id='customMessage'>New or changed data are not stored - Please save data.</span>");
});
}
// var grid = $("#grid").data("kendoGrid");
// grid.tbody.find("tr:gt(0)").find(" td:eq(1)").css(tr_sl);
// grid.tbody.find("td:eq(1)").css('background','#F00');
// var x= grid.tbody.find("tr:gt(0)").find(" td:eq(7)").text();
// alert(x)
// if(x<=0){
// x.css('background','#F00')
// }
// alert(x);
},
columns: [
// { title: "aaaa", field: "num", width: 130,template:inlineTemplate},
{ title: "bbbb", field: "num", width: 130},
{ title: "cccc", field: "proj",width: 60},
{ title: "dddd", field: "type",width: 50},
{ title: "eeee", field: "amount",width: 70},
{ title: "ffff", field: "paid",width: 70},
{ title: "gggg", field: "unpaid",width: 80},
{ title: "hhhh", field: "bl",width: 50}
],
filterable: {
name: "FilterMenu",
extra: true, // turns on/off the second filter option
messages: {
info: "数据筛选选项", // sets the text on top of the filter menu
filter: "执行筛选", // sets the text for the "Filter" button
clear: "取消筛选", // sets the text for the "Clear" button
// when filtering boolean numbers
isTrue: "是", // sets the text for "isTrue" radio button
isFalse: "否" // sets the text for "isFalse" radio button
},
operators: {
//filter menu for "string" type columns
string: {
eq: "等于",
neq: "不等于",
startswith: "指定内容开头",
contains: "内容包括",
endswith: "指定内容结尾"
},
//filter menu for "number" type columns
number: {
eq: "等于",
neq: "不等于",
gte: "大于等于",
gt: "大于",
lte: "小于等于",
lt: "小于"
},
//filter menu for "date" type columns
date: {
eq: "等于",
neq: "不等于",
gte: "大于等于",
gt: "大于",
lte: "小于等于",
lt: "小于"
}
}
},
// toolbar: kendo.template($("#template").html()),
height: h,
groupable: true,
scrollable: true,
sortable: {
mode: "multiple",
allowUnsort: true
},
sortable: true,
sortable: {
mode: "multiple",
allowUnsort: true
},
pageable: true
filterable: true
}).data("kendoGrid");