$('#grid').kendoGrid({
dataSource:{
transport:{
read:{ //读取
url:"", //请求地址
type:"POST", //请求方法 POST GET
dataType:"json" //数据类型
},
update:{},//更新
create:{}, //增加
destroy:{},//删除
parameterMap: function (options, operation) { //自定义请求参数
if(operation=="read"){ //列举读取方法
return {Id:10};
}
}
},
group: { //分组显示
field: "", //分组字段
dir: "asc" //排序方式 asc --- 升序 desc --- 降序
},
requestEnd: function (e) {//请求结束方法
if(e.type=="read"){...}
},
error: function (e) {}//错误处理
}//数据源
selectable:"single row",//选择行方式 single row 选择单行 multiple ---多行 multiple cell ---允许选择多个单元格 single cell---单个单元格
resizable:true, //大小是否可调
scrollable:true, //滚动条
groupable:false, //是否显示分组栏
pageable: { //分页
refresh: true, //是否显示刷新按钮
messages: { //分页显示信息(不定义则使用默认显示方案)
display: "{0} - {1} 共 {2} 条数据",
empty: "没有要显示的数据",
page: "Page",
of: "of {0}",
itemsPerPage: " ",
first: "首页",
previous: "上一页",
next: "下一页",
last: "最后一页",
refresh: "刷新",
},
numeric: true, //是否显示分页按钮 不定义默认为true
previousNext: true, //是否显示翻页按钮 不定义默认为true
info: true, //是否显示分页信息 不定义默认为true
buttonCount: 3 //显示分页按钮数量
},
columns: [{field:"Id",title:"编号",width:50}] //列信息
dataBound: function () {}, //数据绑定事件
cancel: function () {}, //取消编辑事件
editable: "inline" //数据编辑方式 inline ---行内编辑 popup--弹框编辑方式
})
KendoUI Grid分组、分页控件参数记录
最新推荐文章于 2021-07-09 21:40:59 发布