+ -
当前位置:首页 → 问答吧 → 请问大家,使用easyui时查询参数传不过去

请问大家,使用easyui时查询参数传不过去

时间:2011-10-18

来源:互联网

JS代码如下
JScript code

$(function(){
            var queryString = $('#queryForm').formSerialize();
            
            $('#insigGrid').datagrid({
                url: '<%=request.getContextPath()%>/bjtf/ctpf/test.doTestList.hz?'+queryString,
                //url: '<%=request.getContextPath()%>/bjtf/ctpf/demo/MyJsp22.jsp',
                title: 'DataGrid',
                width: 'auto',
                height: 300,
                fitColumns: true,
                nowrap:false,
                pagination:true,
                rownumbers:true,
                pageSize:10,
                columns:[[
                    {field:'UId',title:'编号',width:80},
                    {field:'UName',title:'姓名',width:100},
                    {field:'UCode',title:'代码',width:80,align:'right'},
                    {field:'new',title:'数量',width:80,align:'right'}
                ]]
            });
            
            $('#submitBtn').click(function(){ 
                var qp = $('#insigGrid').datagrid('options').queryParams;
                qp.name = $('#cname').attr('value');
                $('#insigGrid').datagrid('options').queryParams = qp;
                $('#insigGrid').datagrid('reload'); 
            });
        });



HTML代码如下
HTML code

<body>
    <div id="" class="easyui-panel" title="查询条件" collapsible="true" style="padding:5px;">

    <form id="queryForm" method="get" action="<%=request.getContextPath()%>/bjtf/ctpf/demo/MyJsp2.jsp" style="margin-bottom: 2px;">
    <fieldset style="width:100%;"><!-- legend>表单验证</legend -->
        <table id="queryForm" style="width:100%;">
            <tr>
                <td width="15%"><label for="cname">姓名:</label></td><td width="35%"><input id="cname" name="name" size="25" class="easyui-validatebox" /></td>
                <td width="15%"><label for="cemail" class="slabel">E-Mail:</label></td><td width="35%"><input id="cemail" name="email"  class="easyui-validatebox" validType="email"/></td>
            </tr>
            <tr>
               <td><label for="curl" class="slabel">网址:</label></td><td><input id="curl" name="url" size="25" class="url" value="" /></td>
               <td><label for="ccomment" class="slabel">内容:</label></td><td><input id="ccomment" name="comment" class="required" /></td>
            </tr>
            <tr>
               <td colspan="4" align="center">&nbsp;</td>
            </tr>
            <tr>
               <td colspan="4" align="center"><input id="submitBtn" class="submit" type="button" value="提 交" /><input type="reset" value="取 消"/></td>
            </tr>
        </table>
    </fieldset>
    </form>

    </div>
    <br/>
    <div id="" class="easyui-panel" title="查询结果" collapsible="true" style="padding:5px;">
    <table id="insigGrid"></table>
    </div>



后台用request.getParameter("name");取不到值!!

作者: calvin_wyx   发布时间: 2011-10-18

大家百忙之中帮忙看看啊

作者: calvin_wyx   发布时间: 2011-10-18