Jquery easyui的翻页无效,一直都是第一页的数据

Jason_HuaHua 2015-07-09 03:33:26
下面是我用easyui做的一个表格,初次加载10行数据正常,但是我点下一页的时候,后台ashx返回的result数据集是正确的,但是前台的数据就是不变,还是第一页的数据,这是为什么

这是ashx文件返回的result;
case "GetList":
string KeyWord = context.Request["KeyWord"];
string SearchType = context.Request["SearchType"];
if (SearchType == "全部")
{
SearchType = null;
}
int PageSize = Convert.ToInt32(context.Request["rows"]);
int PageNumber = Convert.ToInt32(context.Request["page"]) - 1;
string result = BLL.GetNongQiList(KeyWord, SearchType, PageSize, PageNumber);
context.Response.Write(result);
break;


<script type="text/javascript">

$('#tt').datagrid({
title: "友情链接列表",
url: '../../../Handler/getData.ashx',
pagination: true,
idField: "ID",
queryParams: { method: "GetLink" },
pageNumber: 1,
onLoadSuccess: function (data) {
if (data == "登录超时!") {
top.window.location = "../../SysAdmin/Login.aspx";
}
},
pageSize: 10,
singleSelect: true,
columns: [[
{ field: 'rowIndex', title: '自动编号', width: 100 },
{ field: 'linkname', title: '链接名', width: 100 },
{ field: 'linkurl', title: '链接URL', width: 100 },
{ field: 'type', title: '链接类型', width: 100 },
{ field: 'linkImg', title: '链接图片', width: 100,
formatter: function (value, rowData, rowIndex) {
if (rowData.linkImg != "") {
return '<a href="../../' + rowData.linkImg + '" target="_blank" style="color:black;text-decoration:none;">点击查看</a>';
}
else {
return "暂未上传";
}
}
}
]],
toolbar: [
{
id: 'btnadd',
text: '添加',
iconCls: 'icon-add',
handler: function () {
window.location = 'AddLink.aspx';
return false;
}
}, {
id: 'btnUpdate',
text: '修改',
iconCls: 'icon-edit',
handler: function () {
var selectItem = $('#tt').datagrid('getSelected');
if (selectItem == null) {
$.messager.alert("提示", "请选择要修改的记录!");
}
else {
window.location = "UpdateLink.aspx?id=" + selectItem.id
}
}
}, {
id: 'btnDelete',
text: '删除',
iconCls: 'icon-cut',
handler: function () {
var selectItem = $('#tt').datagrid('getSelections');
var ID = "";
$.each(selectItem, function (key, value) {
ID += value.id;
});
if (ID == "") {
$.messager.alert("提示", "请选择要删除的记录!");
}
else {
$.messager.confirm("提示", "您确定删除选中的数据吗?", function (r) {
if (r) {
$.post("../../../Handler/getData.ashx", { ID: ID, method: "DeleteLink" }, function (data) {
$.messager.alert("提示", data);
$('#tt').datagrid('reload', {
method: "GetLink"
}); //更新列表
}, "html");
}
});
}
}
}]
});



</script>
...全文
140 回复 打赏 收藏 转发到动态 举报
写回复
用AI写文章
回复
切换为时间正序
请发表友善的回复…
发表回复

87,955

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧