- 注册时间
- 2013-12-20
- 最后登录
- 2013-12-24
- 阅读权限
- 10
- 积分
- 25
- 精华
- 0
- 帖子
- 5
|
本帖最后由 LotusTree 于 2013-12-20 11:21 编辑
felt 发表于 2013-12-20 11:09
你运行哪个会有问题?
另外上传页面可以用高级模式打包的
从这个页面- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title>部门管理</title>
- <script src="../scripts/boot.js" type="text/javascript"></script>
- </head>
- <body>
- <form id="form1" action="" method="post">
- <!--操作部分-->
- <div style="width: 800px;">
- <div class="mini-toolbar" style="border-bottom: 0; padding: 0px;">
- <table style="width: 100%;">
- <tr>
- <td style="width: 100%;">
- <a class="mini-button" iconcls="icon-add" onclick="add()">增加</a> <a class="mini-button"
- iconcls="icon-add" onclick="edit()">编辑</a> <a class="mini-button" iconcls="icon-remove"
- onclick="remove()">删除</a>
- </td>
-
- </tr>
- </table>
- </div>
- </div>
- <!--数据表-->
- <div id="datagrid1" class="mini-datagrid" style="width:800px; height: 280px;" allowresize="true"
- url="../ashx/Handler.ashx?method=SearchDepartment" idfield="id" multiselect="true">
- <div property="columns">
- <div type="indexcolumn" width="5"></div>
- <div type="checkcolumn" width="5">
- </div>
- <div field="DepId" width="15" headeralign="center" allowsort="true">
- 部门编号</div>
- <div field="DepName" width="15" headeralign="center" allowsort="true">
- 名称</div>
- <div field="Remark"width="70" headeralign="center" allowsort="true">
- 备注</div>
- </div>
- </div>
- </form>
- <script type="text/javascript">
- mini.parse();
- var grid = mini.get("datagrid1");
- grid.load();
- function add() {
- mini.open({
- url: bootPATH + "../Department/DepartmentWindow.htm",
- title: "新增部门", width: 250, height: 150,
- onload: function () {
- var iframe = this.getIFrameEl();
- var data = { action: "new" };
- iframe.contentWindow.SetData(data);
- },
- ondestroy: function (action) {
-
- grid.reload();
- }
- });
- }
- function edit() {
- var row = grid.getSelected();
- if (row) {
- mini.open({
- url: bootPATH + "../Department/DepartmentWindow.htm",
- title: "编辑部门", width: 250, height: 150,
- onload: function () {
- var iframe = this.getIFrameEl();
- var data = { action: "edit", id: row.DepId };
- iframe.contentWindow.SetData(data);
- },
- ondestroy: function (action) {
- grid.reload();
- }
- });
- } else {
- alert("请选中一条记录");
- }
- }
- function remove() {
- var rows = grid.getSelecteds();
- if (rows.length > 0) {
- if (confirm("确定删除选中记录?")) {
- var ids = [];
- for (var i = 0, l = rows.length; i < l; i++) {
- var r = rows[i];
- ids.push(r.DepId);
- }
- var id = ids.join(',');
- grid.loading("操作中,请稍后......");
- $.ajax({
- url: "../ashx/Handler.ashx?method=RemoveDepartment&id=" + id,
- success: function (text) {
- alert(text);
- grid.reload();
- },
- error: function () {
- }
- });
- }
- } else {
- alert("请选中一条记录");
- }
- }
- function search() {
- var key = mini.get("key").getValue();
- grid.load({ key: key });
- }
- function onKeyEnter(e) {
- search();
- }
-
- function onMarriedRenderer(e) {
- if (e.value == 1) return "是";
- else return "否";
- }
-
- </script>
- </body>
- </html>
复制代码 到这个页面- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <script src="../scripts/boot.js" type="text/javascript"></script>
- <style type="text/css">
- html, body
- {
- font-size: 12px;
- padding: 0;
- margin: 0;
- border: 0;
- height: 100%;
- overflow: hidden;
- }
- </style>
- <title>部门面板</title>
- </head>
- <body>
- <form name="form1" method="post">
- <input name="DepId" class="mini-hidden" />
- <table style="table-layout: fixed;">
- <tr>
- <td style="width: 70px;">
- 部门名称:
- </td>
- <td style="width: 150px;">
- <input name="DepName" class="mini-textbox" onvalidation="onChineseValidation" required="true" emptytext="请输入部门名称" vtype="maxLength:10" />
- </td>
- </tr>
- <tr>
- <td style="width: 70px;">
- 备注:
- </td>
- <td style="width: 150px;">
- <input name="Remark" class="mini-textbox" required="false" vtype="maxLength:50" />
- </td>
- </tr>
- </table>
- <div style="text-align:center;padding:10px;">
- <a class="mini-button" onclick="onOk" style="width:60px;margin-right:20px;">确定</a>
- <a class="mini-button" onclick="onCancel" style="width:60px;">取消</a>
- </div>
- </form>
- </body>
- <script type="text/javascript">
- mini.parse();
- var form = new mini.Form("form1");
- function SaveData() {
- var o = form.getData();
- form.validate();
- if (form.isValid() == false) return;
- var json = mini.encode([o]);
- $.ajax({
- url: "../ashx/Handler.ashx?method=SaveDepartment",
- type: 'post',
- data: { data: json },
- cache: false,
- success: function (text) {
- alert(text);
- CloseWindow("save");
- },
- error: function (jqXHR, textStatus, errorThrown) {
- alert(jqXHR.responseText);
- CloseWindow();
- }
- });
- }
- function SetData(data) {
- if (data.action == "edit") {
- //跨页面传递的数据对象,克隆后才可以安全使用
- data = mini.clone(data);
- $.ajax({
- url: "../ashx/Handler.ashx?method=GetDepartment&id=" + data.id,
- cache: false,
- success: function (text) {
- var o = mini.decode(text);
- form.setData(o);
- form.setChanged(false);
- }
- });
- }
- }
- function GetData() {
- var o = form.getData();
- return o;
- }
- function CloseWindow(action) {
- if (action == "close" && form.isChanged()) {
- if (confirm("数据被修改了,是否先保存?")) {
- return false;
- }
- }
- if (window.CloseOwnerWindow) return window.CloseOwnerWindow(action);
- else window.close();
- }
- function onOk(e) {
- SaveData();
- }
- function onCancel(e) {
- CloseWindow("cancel");
- }
- //验证
- function onChineseValidation(e) {
- if (e.isValid) {
- if (isChinese(e.value) == false) {
- e.errorText = "必须输入中文";
- e.isValid = false;
- }
- }
- }
- /* 是否汉字 */
- function isChinese(v) {
- var re = new RegExp("^[\u4e00-\u9fa5]+$");
- if (re.test(v)) return true;
- return false;
- }
- </script>
- </html>
复制代码 删除可以,添加和修改都不行 |
|