- 注册时间
- 2012-5-23
- 最后登录
- 2014-5-19
- 阅读权限
- 10
- 积分
- 532
- 精华
- 0
- 帖子
- 164
|
本帖最后由 liyang1987ly 于 2012-6-20 23:35 编辑
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<link href="miniui/css/demo.css" rel="stylesheet" type="text/css" />
<script src="miniui/scripts/jquery-1.6.2.min.js" type="text/javascript"></script>
<script src="miniui/scripts/miniui/miniui.js" type="text/javascript"></script>
<link href="miniui/scripts/miniui/themes/default/miniui.css"
rel="stylesheet" type="text/css" />
<link href="miniui/scripts/miniui/themes/icon.css" rel="stylesheet"
type="text/css" />
<!--<link href="scripts/miniui/themes/blue/skin.css" rel="stylesheet" type="text/css" />-->
<link href="miniui/scripts/miniui/themes/icons.css" rel="stylesheet"
type="text/css" />
</head>
<body>
<h1>CRUD</h1>
<div style="padding-top:5px;padding-bottom:5px;">
<input type="button" value="Add" /> <input
type="button" value="Remove" /> <input
type="button" value="Save"
style="margin-left:100px;" />
</div>
<div id="datagrid1" class="mini-datagrid"
style="width:800px;height:280px;"
url="user/getUserAll.do" idField="userId"
allowResize="true" pageSize="10"
allowCellEdit="true" allowCellSelect="true" multiSelect="true" resultAsData="true">
<div property="columns">
<div type="checkcolumn"></div>
<div field="userName" width="120" headerAlign="center"
allowSort="true">
用户名 <input property="editor" class="mini-textbox"
style="width:100%;" />
</div>
<div field="loginName" width="120" headerAlign="center"
align="center" allowSort="true">登陆名称
<input property="editor" class="mini-textbox"
style="width:100%;" /></div>
<div field="loginPass" width="100"
align="center" headerAlign="center">登陆密码
<input property="editor" class="mini-textbox"
style="width:100%;" /></div>
<div field="autValue" width="100" renderer="onGenderRenderer"
allowSort="true" headerAlign="center" align="center">用户角色
<input property="editor" class="mini-combobox" style="width:100%;" data="userRight"/></div>
</div>
</div>
<script type="text/javascript">
mini.parse();
var grid = mini.get("datagrid1");
grid.load();
///////////////////////////////////////////////////////
var userRight = [ {
id : 0,
text : '管理员'
}, {
id : 1,
text : '普通用户'
} ];
function onGenderRenderer(e) {
for ( var i = 0, l = userRight.length; i < l; i++) {
var g = userRight;
if (g.id == e.value)
return g.text;
}
return "";
}
//////////////////////////////////////////////////////
function addRow() {
var newRow = {
name : "New Row"
};
grid.addRow(newRow, 0);
}
function removeRow() {
var rows = grid.getSelecteds();
if (rows.length > 0) {
grid.removeRows(rows, true);
}
}
function saveData() {
var data = grid.getChanges();
var json = mini.encode(data);
grid.loading("保存中,请稍后......");
$.ajax({
url : "../data/AjaxService.aspx?method=SaveChangedEmployees",
data : {
data : json
},
type : "post",
success : function(text) {
grid.reload();
},
error : function(jqXHR, textStatus, errorThrown) {
alert(jqXHR.responseText);
}
});
}
</script>
<div class="description">
<h3>Description</h3>
</div>
</body>
</html>
为什么单元格不能编辑 我是把官方的代码复制 重新修改的 跟官方的一样啊而且没有 那个总的记录数 我返回了 map.put("total", list.size())
|
|