- 注册时间
- 2018-5-2
- 最后登录
- 1970-1-1
- 阅读权限
- 10
- 积分
- 190
- 精华
- 0
- 帖子
- 0
|
datagrid的左下方翻页按钮不能自动翻页?请问是不是需要添加代码?
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="base_material.aspx.cs" Inherits="jjs_base_material" %>
<!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>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link href="../scripts/miniui/themes/default/miniui.css" rel="stylesheet" type="text/css" />
<script src="../scripts/boot.js" type="text/javascript"></script>
<script src="../CommonLibs/UserSelectWindow.js" type="text/javascript"></script>
<script src="../scripts/jquery-1.6.2.min.js" type="text/javascript"></script>
<script src="../scripts/miniui/miniui.js" type="text/javascript"></script>
</head>
<body>
<!--<h1>DataGrid 数据表格</h1> -->
<div style="width:800px;">
<div class="mini-toolbar" style="border-bottom:0;padding:0px;">
<a>编号:</a>
<input id="ID_INPUT_ID" name="INPUT_ID" class="mini-textbox" style=" width:100px" emptyText=""/>
<a>名称:</a>
<input id="ID_INPUT_NAME" name="INPUT_NAME" class="mini-textbox" style=" width:100px" emptyText=""/>
<a>备注:</a>
<input id="ID_INPUT_REMARK" name="INPUT_REMARK" class="mini-textbox" style=" width:150px" emptyText=""/>
<a class="mini-button" iconCls="icon-add">新增</a>
<a class="mini-button" iconCls="icon-edit">修改</a>
<a class="mini-button" iconCls="icon-remove">删除</a>
<a class="mini-button" iconCls="icon-reload">刷新</a>
</div>
</div>
<div id="datagrid1" class="mini-datagrid" style="width:800px;height:580px;" allowResize="true"
idField="TRAIN_NO" multiSelect="true"
>
<div property="columns">
<div type="checkcolumn" ></div>
<div field="ID" width="120" headerAlign="center" allowSort="true">编码</div>
<div field="NAME" width="120" headerAlign="center" allowSort="true">名称</div>
<div field="REMARK" width="120" headerAlign="center" allowSort="true">备注</div>
<div field="OPER_DATE" width="120" headerAlign="center" dateFormat="yyyy-MM-dd hh:mm:ss" allowSort="true">操作时间</div>
<div field="OPERATOR" width="120" headerAlign="center" allowSort="true">操作人</div>
</div>
</div>
<script type="text/javascript">
mini.parse();
var obj = mini.getParams();
var grid = mini.get("datagrid1");
// grid.load();
var url = location.search;
var Request = new Object();
if (url.indexOf("?") != -1) {
var str = url.substr(1)//去掉?号
strs = str.split("&");
for (var i = 0; i < strs.length; i++) {
Request[strs[i].split("=")[0]] = unescape(strs[i].split("=")[1]);
}
}
grid.setUrl("../jjs/jjs_webtoserver.aspx?method=GetMaterialAll");
grid.load()
grid.gotoPage(1, 100);
//sessionStorage.setItem('OPERATOR', 'SYS');
function add() {
var txt_id = mini.getbyName("INPUT_ID").value;
var txt_name = mini.getbyName("INPUT_NAME").value;
var txt_remark = mini.getbyName("INPUT_REMARK").value;
var paramsObj = {
txt_id: txt_id,
txt_name: txt_name,
txt_remark: txt_remark,
}
if (confirm("您是否确定增加数据吗?")) {
grid.loading("操作中,请稍后......");
$.ajax({
url: "../jjs/jjs_webtoserver.aspx?method=base_material_add",
type: 'post',
data: paramsObj,
success: function (text) {
grid.reload();
},
error: function () {
}
});
}
}
function edit() {
var currentRow = grid.getSelected();
var row = grid.indexOf(currentRow);
var txt_id = grid.data[row]["ID"];
var rows = grid.getSelecteds();
var txt_name = mini.getbyName("INPUT_NAME").value;
var txt_remark = mini.getbyName("INPUT_REMARK").value;
var paramsObj = {
txt_id: txt_id,
txt_name: txt_name,
txt_remark: txt_remark
}
if (rows.length > 0) {
if (confirm("您是否确定修改选定数据吗?")) {
grid.loading("操作中,请稍后......");
$.ajax({
url: "../jjs/jjs_webtoserver.aspx?method=base_material_modify",
data: paramsObj,
type: "post",
success: function (text) {
grid.reload();
},
error: function () {
}
});
}
} else {
alert("请选中一条记录");
}
}
$('#datagrid1').click(function () {
var currentRow = grid.getSelected();
var row = grid.indexOf(currentRow);
mini.get("ID_INPUT_ID").setValue(grid.data[row]["ID"]);
mini.get("ID_INPUT_NAME").setValue(grid.data[row]["NAME"]);
mini.get("ID_INPUT_REMARK").setValue(grid.data[row]["REMARK"]);
});
function remove() {
var currentRow = grid.getSelected();
var rows = grid.getSelecteds();
var row = grid.indexOf(currentRow);
var txt_id = grid.data[row]["ID"];
if (rows.length > 0) {
if (confirm("确定删除选中记录?")) {
var paramsObj = {
txt_id: txt_id
}
grid.loading("操作中,请稍后......");
$.ajax({
url: "../jjs/jjs_webtoserver.aspx?method=base_material_del",
data: paramsObj,
type: "post",
success: function (text) {
grid.reload();
},
error: function () {
}
});
}
} else {
alert("请选中一条记录");
}
}
function reupdate() {
grid.reload();
}
</script>
<div class="description">
<!-- <h3>Description</h3>-->
</div>
</body>
</html>
|
|