easyui datagrid checkbox
来源:互联网 发布:mac 安卓sdk环境变量 编辑:程序博客网 时间:2024/05/01 06:31
function GridView() { $('#tdg').datagrid({ title: '管理员信息列表', /*表头*/ iconCls: 'icon-save', /*图标*/ nowrap: true, /*设置为true,当数据长度超出列宽时将会自动截取。*/ striped: true, /*设置为true将交替显示行背景。*/ url: '../ashx/admin.ashx?action=paging', remoteSort: false, sortName: 'CreateDate', singleSelect: true, sortOrder: 'desc', fit: true, /*自动补全*/ fitColumns: true, rownumbers: true, frozenColumns: [[ { title: '编号', field: 'Id', width: 50, align: 'left', checkbox: true, sortable: true }, { field: 'AdminLogName', title: '登录账号', width: 80, align: 'left', sortable: true }, { field: 'AdminLogPass', title: '登录密码', width: 80, align: 'left', sortable: true, formatter: function (value, row, index) { return "********"; } } ]], columns: [[ { field: 'AdminName', title: '用户姓名', width: 80, align: 'left', sortable: true }, { field: 'AdminTel', title: '用户电话', width: 80, align: 'left', sortable: true }, { field: 'UnitCode', title: '组织单位代码', width: 80, align: 'left', sortable: true }, { field: 'AdminType', title: '用户类型', width: 80, align: 'left', sortable: true, formatter: function (value, row, index) { if (6 == value) { return "部级"; } else if (5 == value) { return "省级"; } else if (4 == value) { return "市级"; } else if (3 == value) { return "县市级"; } else if (2 == value) { return "乡镇级"; } else if (1 == value) { return "村级"; } else if (0 == value) { return "组级"; } } }, { field: 'AdminState', title: '用户状态', width: 50, align: 'left', sortable: true, formatter: function (value, row, index) { var s = row.AdminState == 0 ? "<span style='color:red;'>禁用</span>" : "<span style='color:blue;'>正常<span>"; return s += " <img onclick=\"OnRowsStateClick('" + row.Id + "','AdminState','" + row.AdminState + "');\" src='../images/" + row.AdminState + ".gif' align='absmiddle' />"; } }, { field: 'AdminLogNum', title: '登录次数', width: 50, align: 'left', sortable: true }, { field: 'IsCheck', title: '越级审核权限', width: 50, align: 'left', sortable: true, formatter: function (value, row, index) { var c = row.IsCheck == 0 ? "否" : "是"; return c += " <img onclick=\"OnRowsStateClick('" + row.Id + "','IsCheck','" + row.IsCheck + "');\" src='../images/" + row.IsCheck + ".gif' align='absmiddle' />"; } }, { field: 'EndDate', title: '最后登录时间', width: 80, align: 'left', sortable: true }, { field: 'CreateDate', title: '创建时间', width: 80, align: 'left', sortable: true } ]], singleSelect: false, selectOnCheck: true, checkOnSelect: true, toolbar: [{ id: 'btnadd', text: '新建', iconCls: 'icon-add', handler: function () { $("#mainCenter").hide(); $("#adminUserEdit").show(); $("#btnAdd").show(); $("#btnEdit").hide(); EmptyTextClick(); } }, '-', { id: 'btndel', text: '删除', iconCls: 'icon-no', handler: function () { /*删除操作region*/ var rows = $('#tdg').datagrid('getSelections'); if (rows.length > 0) { $.messager.confirm('询问提示', '您确定要删除选中的用户信息吗?', function (data) { if (data) { var ids=''; if (rows.length > 0) { for (var i = 0; i < rows.length; i++) { ids += rows[i].Id + ','; } } $.get("../ashx/admin.ashx?action=del", { id: ids }, function (data) { msgShow("提示", data, "info"); $('#tdg').datagrid('clearSelections'); $('#tdg').datagrid('reload'); }, "text"); } }); } else { msgShow("提示", "您还没有选中要删除的信息?", "warning"); } /*end*/ } }, '-', { id: 'btncut', text: '修改', iconCls: 'icon-cut', handler: function () { /*修改操作region */ var rows = $('#tdg').datagrid('getSelections'); if (rows.length > 0) { EmptyTextClick(); /**/ // $.messager.progress(); $.get("../ashx/admin.ashx?action=id", { Id: rows[0].Id }, function (data) { $("#txtAdminLogName").textbox('setValue', data.AdminLogName); $("#txtAdminLogPass").val(data.AdminLogPass); $("#txtUnitCode").textbox('setValue', data.UnitCode); $("#txtAdminName").textbox('setValue', data.AdminName); $("#txtAdminTel").textbox('setValue', data.AdminTel); $("#txtAdminState").combobox('setValue', data.AdminState); $("#txtIsCheck").combobox('setValue', data.IsCheck); $("#roleid").combobox('setValue', data.Roleid); /**/ $("#txtId").val(data.Id); $("#txtAdminType").val(data.AdminType); $("#txtAdminLogNum").val(data.AdminLogNum); }, "json"); // $("#mainCenter").hide(); $("#btnAdd").hide(); $("#btnEdit").show(); $("#adminUserEdit").show(); } else { msgShow("提示", "您还没有选中要修改的列信息?", "warning"); } /*end*/ } } ], pagination: true, pageSize: _rows }); var p = $('#tdg').datagrid('getPager'); $(p).pagination({ onBeforeRefresh: function () { } });}
0 0
- EasyUI datagrid editor checkbox
- easyui datagrid checkbox
- easyui datagrid checkbox
- easyui datagrid 去掉 全选checkbox
- easyui datagrid editor checkbox 选中
- easyui datagrid 引用checkbox失效
- easyui datagrid多列checkbox
- easyUI 添加CheckBox选择到DataGrid
- easyUI-Datagrid设置checkbox时默认选中
- jQuery EasyUI DataGrid 禁用某行Checkbox
- easyui datagrid editor checkbox 单击事件
- EASYUI DATAGRID 多列复选框CheckBox
- EASYUI DATAGRID 多列复选框CheckBox
- EASYUI DATAGRID 多列复选框CheckBox
- EasyUI datagrid实现翻页保持checkbox状态
- easyui datagrid 分页保持checkbox选中状态
- easyui-datagrid checkbox和radio组合使用
- EASYUI DATAGRID 多列复选框CheckBox
- Property 'sqlMapClient' is required
- MVC view与control数据传递
- 搜索——二分搜索实现及细节
- 深入分析JavaWeb 20 -- EL表达式和EL函数库
- javabean in structs2
- easyui datagrid checkbox
- 太平洋皇冠证券按照2015年第四季度的收入计算,列出了全球企业云服务收入最多的10家科技公司
- HDU 5366 The mook jong
- Drawable资源
- Java和C的区别
- SharedPreferences跨进程访问
- jmeter--csv data set config
- 使用 CXF 做 webservice 简单例子
- 架构设计:负载均衡层设计方案(1)——负载场景和解决方式