1 $('#grid').kendoGrid({
2 dataSource:{
3 transport:{
4 read:{ //读取
5 url:"", //请求地址
6 type:"POST", //请求方法 POST GET
7 dataType:"json" //数据类型
8 },
9 update:{},//更新
10 create:{}, //增加
11 destroy:{},//删除
12 parameterMap: function (options, operation) { //自定义请求参数
13 if(operation=="read"){ //列举读取方法
14 return {Id:10};
15 }
16 }
17 },
18 group: { //分组显示
19 field: "", //分组字段
20 dir: "asc" //排序方式 asc --- 升序 desc --- 降序
21 },
22 requestEnd: function (e) {//请求结束方法
23 if(e.type=="read"){...}
24 },
25 error: function (e) {}//错误处理
26
27 }//数据源
28 selectable:"single row",//选择行方式 single row 选择单行 multiple ---多行 multiple cell ---允许选择多个单元格 single cell---单个单元格
29 resizable:true, //大小是否可调
30 scrollable:true, //滚动条
31 groupable:false, //是否显示分组栏
32 pageable: { //分页
33 refresh: true, //是否显示刷新按钮
34 messages: { //分页显示信息(不定义则使用默认显示方案)
35 display: "{0} - {1} 共 {2} 条数据",
36 empty: "没有要显示的数据",
37 page: "Page",
38 of: "of {0}",
39 itemsPerPage: " ",
40 first: "首页",
41 previous: "上一页",
42 next: "下一页",
43 last: "最后一页",
44 refresh: "刷新",
45 },
46 numeric: true, //是否显示分页按钮 不定义默认为true
47 previousNext: true, //是否显示翻页按钮 不定义默认为true
48 info: true, //是否显示分页信息 不定义默认为true
49 buttonCount: 3 //显示分页按钮数量
50 },
51 columns: [{field:"Id",title:"编号",width:50}] //列信息
52 dataBound: function () {}, //数据绑定事件
53 cancel: function () {}, //取消编辑事件
54 editable: "inline" //数据编辑方式 inline ---行内编辑 popup--弹框编辑方式
55 })