/// <summary>
/// 获取每页显示条数
/// </summary>
/// <returns></returns>
public Int32 GetPageSize()
{
try
{
return Int32.Parse(_context.Request["rows"].ToString());
}
catch
{
return 10;
}
}
但是前台每页看见传递rows参数:
后来发现这是jqgrid自带的。
这里jqgrid....js里面的参数:
在网上搜索了资料如下:
String page = request.getParameter("page"); // 取得当前页数,注意这是jqgrid自身的参数
String rows = request.getParameter("rows"); // 取得每页显示行数,,注意这是jqgrid自身的参数
2:在一定条件下添加某一列:
list_columns = [
{ name: 'GID', title: '', width: 40, align: 'center', hidden: true, frozen: true },//主键必须加上,并且隐藏
]
var bzdxcolumn = [{
name: 'ISFDBDX', title: '你好啊', width: 53, align: 'center', sortable: false,
formatter: function (value, rec) {
return getIcon(value);
}
}];
if ($("#hidType").val()!="04") {
list_columns.push(bzdxcolumn[0]);
}
3:列表点击按钮
var frozenColumns = [
{ name: 'GID', title: '', width: 40, align: 'center', hidden: true, frozen: true }, //主键必须加上,并且隐藏
{ name: 'GLC', title: '', width: 40, align: 'center', hidden: true, frozen: true },
{ name: 'SJTLBCODE', title: '', width: 40, align: 'center', hidden: true, frozen: true },
{ name: 'LC_ACTIVITYID', title: '', width: 40, align: 'center', hidden: true, frozen: true },
{
name: 'opt', title: '操作', width: 40, align: 'center', frozen: true,
formatter: function (value, rec, row) {
return "<a href=\"#\" class=\"alink\" onclick=\"View2('" + row.GID + "','家庭信息查看',true);return false;\"><span style=\"color:#15428B\">查看</span></a>";
}
}