我是通过jQuery自带的ajax传值的方式将条件传值到另一个页面的。但是不知道如何获取设定的页面pagesize的值。
请问我在另一个aspx或者ashx页面如何获取设定的这个pagesize的值。如图

解决方案 »

  1.   

    我是用JAVA 在另一个jsp页面上 
    public org.json.JSONArray methodNm(org.json.JSONObject json)throws Exception{
      System.out.println(json);
      //methodName,你要获取Datagrid数据的方法
      //你指的那个PageSize 在这边的json里 key 为 rows
      //pageNum ==> page
    }
      

  2.   

    HttpContext接收ajax里面的data值context.Request["pagesize"]
    如果你的pagesize是在下拉框中,直接用jq的选择器获取select的值就行
      

  3.   

    它这里传的参数是 page rows page是页数rows是每页记录数
      

  4.   

    $(function(){
    $('#test').datagrid({
    title:'Ont详细信息',
    iconCls:'icon-save',
    width:1000,
    height:700,
    nowrap: false,
    striped: true,
    collapsible:true,
    url:'./ui/ShowOntInfo.ashx',
    queryParams: {
                    'currentPage': 1,
                    'pageSize': 20
                    },
    sortName: 'code',
    sortOrder: 'desc',
    remoteSort: false,
    idField:'code',
    frozenColumns:[[
                    {field:'ck',checkbox:true},
                    {title:'编号',field:'id',width:80,sortable:true}
    ]],
    columns:[[
            {title:'表格基本信息',colspan:5},
    {field:'opt',title:'操作',width:100,align:'center', rowspan:2,
    formatter:function(value,rec){
    return '<span style="color:red">编辑 删除</span>';
    }
    }
    ],[
        {title:'Sn',field:'sn',width:120},
    {field:'ont_seat',title:'位置',width:60},
    {field:'spliter',title:'分光器号',width:60},
    {field:'group_id',title:'猫车分组',width:60,rowspan:2,
    formatter:function(value,rec){
    return "<span style='color:red'>"+value+"</span>";
    }
    },
    {field:'ont_car',title:'猫车号',width:60,rowspan:2,sortable:true,
    sorter:function(a,b){
    return (a>b?1:-1);
    }
    }
    ]],
    pagination:true,
    pageList: [20, 30, 50 ],
    rownumbers:true,
    singleSelect:true ,   
    toolbar:[{
    id:'btnadd',
    text:'Add',
    iconCls:'icon-add',
    handler:function(){
    $('#btnsave').linkbutton('enable');
    alert('add')
    }
    },{
    id:'btncut',
    text:'Cut',
    iconCls:'icon-cut',
    handler:function(){
    $('#btnsave').linkbutton('enable');
    alert('cut')
    }
    },'-',{
    id:'btnsave',
    text:'Save',
    disabled:true,
    iconCls:'icon-save',
    handler:function(){
    $('#btnsave').linkbutton('disable');
    alert('save')
    }
    }]
    });
    var p = $('#test').datagrid('getPager');
    $(p).pagination({
    onBeforeRefresh:function(){
    alert('before refresh');
    }
    });

    $( '#test' ).datagrid( 'getPager' ).pagination( {
                  onSelectPage: function( pageNumber, pageSize ) {
                 $( '#test' ).datagrid( 'reload', $.extend( $( '#test' ).datagrid( 'options' ).queryParams, {
                    'currentPage': pageNumber,
                    'pageSize': pageSize
                } ) );
      }
               } );

    });