easyui的datagrid,如何将检索条件传递到查询页面呢?

daoyuanjiao 2014-03-04 02:51:20
我有一个easyui的datagrid,如何将检索条件传递到查询页面呢?
<script  type="text/javascript" charset="utf-8">
$(function(){
datagrid_Monthkaohe=$('#jixiaokaohe').datagrid({
url:'MonthkaoheSearch.asp',
title:'',
iconCls:'',
fit:true,
fitColumns:true,
nowrap : false,//一行显示所有数据,容不下时,会自动换行显示
rownumbers : true,//显示行号
columns:[[{
field:'Year',
title:'考核年度',
width:100,align:'centre',halign:'center',
rowStyler: function(index,row){
return 'background-color:#6293BB;color:#fff;';
}
},{
field:'jixiao_shijian',
title:'考核月份',
width:100,align:'centre',halign:'center'
},{
field:'jixiao_defen',
title:'考核得分',
width:100,align:'centre',halign:'center',
sortable:true
},{
field:'jixiao_jiafenyuanyin',
title:'加分原因',
width:300,align:'centre',halign:'center'
},{
field:'jixiao_koufenyuanyin',
title:'扣分原因',
width:300,
sortable:true ,align:'centre',halign:'center'
},{
field:'jixiao_beizhu',
title:'备注',
width:100,align:'centre',halign:'center'
}]],

});
});
searchData=function(){
xingming_id="<%=requestid%>"
datagrid_Monthkaohe.datagrid('load',{
KSMonth:$('#form1').find('[name=KSMonth]').val(),
JSMonth:$('#form1').find('[name=JSMonth]').val(),
xm_id:$('#form1').find('[name=requestid]').val()

})
alert("<%=requestid%>");
alert($('#form1').find('[name=KSMonth]').val())
alert(xingming_id);
}
</script>



<table class="datagrid-toolbar" style="width:100%; height:=100%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#009966">
<tr>
<td> 开始日期:<input name="KSMonth" id="KSMonth" type="text" class="Wdate" size="155px" onclick="WdatePicker({maxDate:'#F{$dp.$D(\'JSMonth\',{d:0})}'})" value="<%if request("KSMonth")<>"" then%><%=request("KSMonth")%><%else%><%=DateAdd("m",-1,date())%><% end if%>"></td>
<td>结束日期<input input name="JSMonth" id="JSMonth" type="text" size="155px" onClick="WdatePicker({minDate:'#F{$dp.$D(\'KSMonth\',{d:0})}'})" class="Wdate" value="<%if request("JSMonth")<>"" then%><%=request("JSMonth")%><%else%><%=year(now())%>-<%=month(now())%>-<%=day(now())%><%end if%>"></td>
<td align="center"><a href="javascript:void(0);" class="easyui-linkbutton" onClick="searchData();">查询</a>
<a id="btn" href="MonthkaoheSearch.asp" class="easyui-linkbutton" data-options="iconCls:'icon-search'">easyui</a> <input type="text" name="requestid" id="requestid" value="<%=request("requestid")%>"></td>
</tr>
</table>


这个是我的查询数据MonthkaoheSearch.asp页面
<%
DIM r,rs,jObj,sqlstr,rows1
xingming_id=CInt(request("xm_id"))'姓名编号
KSMonth=request("KSMonth") '开始时间
JSMonth=request("JSMonth") '结束时间
'xingming_id=229
'拼WHERE条件
whereSql=" where 1=1 and xingming_id="&xingming_id&" "

if KSMonth<>"" then whereSql=whereSql&" and jixiao_shijian>=#" & KSMonth & "#"
if JSMonth<>"" then whereSql=whereSql&" and jixiao_shijian<=#" & JSMonth & "#"
rowCount=null

set rs=server.CreateObject("adodb.recordset")
sqlstr="select * from jixiao "&whereSql

'Response.Write sqlstr
rs.open sqlstr,conn,0,1
SET jObj=NEW simpleJson
SET r=jObj.DataBind(rs,rowCount)
Response.Write(KSMonth)
Response.Write(xingming_id)
Response.Write r.parseString()
%>

现在就是说这个asp页面收不到request("KSMonth")这几个参数,全部都是空!
谢谢!
...全文
788 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
Go 旅城通票 2014-03-05
  • 打赏
  • 举报
回复
searchData=function(){ xingming_id="<%=requestid%>" datagrid_Monthkaohe.datagrid('load',{ KSMonth:$('#form1').find('[name=KSMonth]').val(), JSMonth:$('#form1').find('[name=JSMonth]').val(), xm_id:$('#form1').find('[name=requestid]').val() }) alert("<%=requestid%>"); alert($('#form1').find('[name=KSMonth]').val()) alert(xingming_id); } 有内容没有??红色部分输出
daoyuanjiao 2014-03-05
  • 打赏
  • 举报
回复
有输出的,不过问题倒是解决了!就是将将searchData()放在$(function()的最后,让其自动执行一次就行了!
daoyuanjiao 2014-03-04
  • 打赏
  • 举报
回复
如果我在MonthkaoheSearch.asp中将xingming_id、KSMonth、JSMonth直接赋值,是可以查询到数据的!现在我不知道怎么将查询页面的input中的值传递给MonthkaoheSearch.asp来进行数据筛选!谢谢!
yangtututu 2014-03-04
  • 打赏
  • 举报
回复
var param = {“age” :18}; $("#tt").datagrid("load", param) 实例化JSON再传, LOAD之前确定你的FIND数据不为空

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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