第一节:EasyUI常用手法

一丶常用属性

 1     $('#j_dg_left').datagrid({
 2                 url: '/Stu_Areas/Stu/GradeList',
 3                 fit: true, // 自动适应父容器大小
 4                 singleSelect: true, //设置是否只能单选
 5                 loadMsg: '请稍等,正在拼命加载...',//加载数据的时候显示提示消息
 6                 fitColumns: true, //自动收缩列的大小
 7                 rownumbers: true, //是否加行号
 8               pagination: true, //是否显式分页
 9                 pageSize: 5, //页容量,必须和pageList对应起来,否则会报错
10                 pageNumber: 1, //默认显示第几页
11                 pageList: [5, 10, 15],//分页中下拉选项的数值
12                 checkOnSelect: true,//当用户点击行的时候该复选框就会被选中或取消选中。
13                 selectOnCheck: true,//单击复选框将永远选择行
14                 //固定列
15                 frozenColumns: [[
16                      { field: 'gName', title: '年级名称', width:150, align: 'center' },
17                 ]],
18                 //非固定列
19                 columns: [[
20                      { field: 'gExplain', title: '年级说明', width: 150, align: 'center' },
21                 ]],
22                 //单击单元格
23                 onClickRow: function (index, row) {
24                     dg_right.datagrid('load', {
25                         gId: row.gId,
26                     });
27                     gId = row.gId;
28                 },
29                 onLoadSuccess: function () {
30                     //修改全选按钮
31                     $(".datagrid-header-check").html("序号");
32                     $(".datagrid-header-check").parent().prev().html("");
33                     $(".datagrid-header-check").attr("style", "width:71px")
34                     var rows = dg_left.datagrid('getRows');
35                     if (rows.length > 0) {
36                         pageUtil.LoadGrid_Right(rows[0].gId);
37                     }
38                 },
39                 toolbar: [{
40                     text: '刷新',
41                     iconCls: 'fa fa-refresh',
42                     handler: function () {
43                         pageUtil.Refresh();
44                     }
45                  }
46                  ,
47                   '-', {
48                       text: '取消选中',
49                       iconCls: 'fa fa-undo',
50                       handler: function () {
51                           pageUtil.CancelSelected();
52                       }
53                   },
54                    '-', {
55                        text: '添加',
56                        iconCls: 'fa fa-plus',
57                        handler: function () {
58                            pageUtil.AddStudent();
59                        }
60                    },
61                    '-', {
62                        text: '编辑',
63                        iconCls: 'fa fa-edit',
64                        handler: function () {
65                            pageUtil.EditStudent();
66                        }
67                    },
68                   '-', {
69                       text: '删除',
70                       iconCls: 'fa fa-remove',
71                       handler: function () {
72                           pageUtil.DelStudent();
73                       }
74                   },
75                 ],
76     })
View Code

猜你喜欢

转载自www.cnblogs.com/chenze-Index/p/9328437.html