- 注册时间
- 2012-6-12
- 最后登录
- 2012-12-26
- 阅读权限
- 10
- 积分
- 273
- 精华
- 0
- 帖子
- 79
|
niko 发表于 2012-6-26 20:52
你应该没到最新版本把。
或者把可运行的代码贴出来试试
<div>
<div class="mini-toolbar" style="width: 889px;">
<a class="mini-button" iconcls="icon-add" onclick="AddServerManage">增加</a> <a
class="mini-button" iconcls="icon-remove" onclick="deleteUsers"> 删除</a> <span class="separator">
</span>服务器Ip:
<input id="txtSearchServerIp" class="mini-textbox" />
<a class="mini-button" iconcls="icon-search" onclick="SearchServerManage">查询</a>
</div>
<div id="datagrid1" class="mini-datagrid" style="width: 900px; height: 530px;" url="../Handle/ServerManage.aspx?Method=GetServer"
idfield="id" allowresize="false" pagesize="20" multiselect="true">
<div property="columns">
<div type="checkcolumn" width="5">
</div>
<div type="indexcolumn" width="10">
</div>
<div field="ServerId" width="10" headeralign="center" align="center" allowsort="true">
ID
</div>
<div field="ServerName" width="10" headeralign="center" align="center" allowsort="true">
服务器名
</div>
<div field="ServerIp" width="30" headeralign="center" align="center" allowsort="true">
服务器IP
</div>
<div name="action" width="20" headeralign="center" align="center" renderer="onActionRendererUserManage"
cellstyle="padding:0;">
操作</div>
</div>
</div>
<div id="editServerManage" class="mini-window" title="新增/编辑服务器管理" style="width: 450px;"
showmodal="true" allowdrag="true">
<div id="editServerManageform" class="form">
<input class="mini-hidden" name="ServerId" />
<table style="width: 410px">
<tr>
<td style="width: 100px; text-align: right;">
服务器名称:
</td>
<td style="width: 300px;">
<input name="ServerName" width="300" class="mini-textbox" />
</td>
</tr>
<tr>
<td style="width: 100px; margin-top: 10px; text-align: right;">
服务器IP:
</td>
<td style="width: 300px; margin-top: 10px;">
<input name="ServerIp" id="txtServerIP" width="300" class="mini-textbox" onvalidation="onvalidateIpAddress" />
</td>
</tr>
<tr>
<td style="width: 100px; margin-top: 10px; text-align: right;">
服务器说明:
</td>
<td style="width: 300px; margin-top: 10px;">
<input name="ServerDesc" width="300" id="txtUserDescription" required="true" requirederrortext="服务器说明不能为空"
class="mini-textarea" />
</td>
</tr>
<tr>
<td style="text-align: center; padding-top: 5px; padding-right: 20px;" colspan="2">
<a class="mini-button" iconcls="icon-add" onclick="SaveServerManage">保存</a> <a class="mini-button"
iconcls="icon-cancel" onclick="CanncelSaveServerManage">取消</a>
</td>
</tr>
</table>
</div>
</div>
</div>
<script type="text/javascript">
mini.parse();
var grid = mini.get("datagrid1");
var editWindow = mini.get("editServerManage");
var cmdType = "AddServer";
grid.load();
function SearchServerManage() {
var txtSearchKey = mini.get("txtSearchServerIp");
var key = txtSearchKey.getValue();
grid.load({ key: key });
}
//验证
function onvalidateIpAddress(e) {
debugger;
if (e.isValid) {
var reg = /^(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9])$/;
if (!reg.test(e.value)) {
e.errorText = "Ip格式输入错误!";
e.isValid = false;
}
}
}
//加载列表格的时候
function onActionRendererUserManage(e) {
var grid = e.sender;
var record = e.record;
var uid = record._uid;
var rowIndex = e.rowIndex;
//<img src="../JS/scripts/miniui/themes/icons/edit.gif" />
var s = '<a onclick="editSingleServer(\'' + uid + '\');" style="cursor:pointer;"><img src="../JS/scripts/miniui/themes/icons/edit.gif"/>修改</a> '
+ '<a onclick="DeleteSingleServer(\'' + uid + '\')" style="cursor:pointer;"><img src="../JS/scripts/miniui/themes/icons/cancel.gif"/>删除</a>';
return s;
}
function DeleteSingleServer(row_id) {
mini.confirm("确定删除(删除后将不能恢复)?", "确定?", function (action) {
if (action == "ok") {
var row = grid.getRowByUID(row_uid);
if (row) {
var serverId = row.ServerId;
$.ajax({
url: "../Handle/ServerManage.aspx?Method=DeleteSingleServer",
type: "post",
cache: "false",
dataType: "text",
data: { "ServerId": serverId },
success: function (msg) {
}
});
}
}
});
}
//修改单个
function editSingleServer(row_id) {
var row = grid.getRowByUID(row_id);
if (row) {
editWindow.show();
var form = new mini.Form("#editServerManageform");
form.loading();
form.setData(row);
form.unmask();
cmdType = "UpdateServer";
}
}
//新增服务器
function AddServerManage() {
editWindow.show();
var form = new mini.Form("#editServerManageform");
form.clear();
cmdType = "AddServer";
}
function CanncelSaveServerManage() {
mini.confirm("确定取消保存(取消保存后将不能恢复)?", "确定?", function (action) {
if (action == "ok") {
editWindow.hide();
}
});
}
//保存服务器信息
function SaveServerManage() {
var form = new mini.Form("#editServerManageform");
form.validate();
if (form.validate() == false) {
return;
}
mini.confirm("确定保存?", "确定?", function (action) {
if (action == "ok") {
var obj = form.getData();
var jsona = mini.encode([obj]);
var json = $.parseJSON(jsona);
grid.loading("保存中,请稍后...");
$.ajax({
url: "../Handle/ServerManage.aspx?Method=" + cmdType,
type: "post",
cache: "false",
dataType: "text",
data: {
"ServerId": json[0].ServerId,
"ServerName": json[0].ServerName,
"ServerIp": json[0].ServerIp,
"ServerDesc": json[0].ServerDesc
},
success: function (msg) {
if (msg == 1) {
mini.alert("保存成功!");
grid.load();
}
else {
mini.alert("保存失败");
grid.load();
}
}
});
}
}
);
}
</script>
这是我一整个页面的代码,怎么试都不行... 这个是点修改,然后弹出修改框,修改完之后,再点保存的时候是 获取不到值,要么就是获取到的 还是 原来 没修改的值,不知道是不是哪弄错了,感觉很奇怪 |
|