easyUI分页中,分页情况下跳转到另一页,修改资料后返回到原页数页面。今天分享一下微小成果;
[color=red]基本原理[/color]是:传当前页码到另一页,然后另外一页接收再传回到原页面;
1.a.jsp下面是传参数:
var grid = $('#companyListTable');
var options = grid.datagrid('getPager').data("pagination").options;
var curr = options.pageNumber; //获得当前页
var a = '<a title="编辑" href="'+basePath+'product/company/add_edit.action?page='+curr+'&id='+row.id+'">编辑</a> | ';
2.b.jsp接收参数,在返回参数:
var page = '<s:property value="page" />';
var result = BossHelper.submitForm({});
if (!result) {
return;
}else{
location.href = basePath + 'product/company/list.action?page='+page;
}
3.a.jsp再接收参数:
var page = '<s:property value="page" />';
[color=red]page=parseInt(page);[/color]
var url = basePath + 'product/company/show.action';
$('#companyListTable').datagrid({
url: url,
pageNumber:page
});
最好就到达自己想要的效果了
[color=red]基本原理[/color]是:传当前页码到另一页,然后另外一页接收再传回到原页面;
1.a.jsp下面是传参数:
var grid = $('#companyListTable');
var options = grid.datagrid('getPager').data("pagination").options;
var curr = options.pageNumber; //获得当前页
var a = '<a title="编辑" href="'+basePath+'product/company/add_edit.action?page='+curr+'&id='+row.id+'">编辑</a> | ';
2.b.jsp接收参数,在返回参数:
var page = '<s:property value="page" />';
var result = BossHelper.submitForm({});
if (!result) {
return;
}else{
location.href = basePath + 'product/company/list.action?page='+page;
}
3.a.jsp再接收参数:
var page = '<s:property value="page" />';
[color=red]page=parseInt(page);[/color]
var url = basePath + 'product/company/show.action';
$('#companyListTable').datagrid({
url: url,
pageNumber:page
});
最好就到达自己想要的效果了