datagrid 表单查询时的问题

龙影 发布于 2014/06/23 12:20
阅读 1K+
收藏 0

 请问下大家有没碰到这样的情况:


红框中的下拉框在点击查询后会自动重置并且会向后台重新取数据
调用datagrid查询代码如下:
function dataGridSearch(dataGridId_,searchForm_id) {
var form;
if(searchForm_id==undefined||searchForm_id==null)
form=$("#searchForm");
else
form=$("#"+searchForm_id);
getDataGridbyId(dataGridId_).datagrid('load', sy.serializeObject(form));
}

我这边也没做重置啊,一直不能解决这个问题 

加载中
0
龙影
龙影

补充下代码:

<script type="text/javascript" charset="utf-8">
var datagrid,searchForm,url_=root+"/crm/custdemand";
	$(function() {
		datagrid = $('#datagrid').datagrid({toolbar:'#dgtb',url :url_+'/dataGrid?qryField=XQLX_in,STATE_in,KHXQ_in,KEY',title:'',iconCls:'',singleSelect:true,pagination:true,pageSize:50,pageList:[20,50,100 ],
			fit:true,fitColumns:false,	rownumbers:true,	nowrap:true,border:false,idField:'ID',
			columns:[ [
{title:'需求类型',field:'XQLX',sortable:true},
{title:'客户',field:'CUSTID',sortable:true,formatter:function(v,r){
	return "<a href='javasript:void(0);' onclick='view(-1,\"客户:"+r.CNAME+"\",null,\"/crm/customer/view/"+r.CUSTID+"\")'>"+r.CNAME+"["+v+"]</a>";
	}},
{title:'状态',field:'STATE',sortable:true},
{title:'客户需求',field:'KHXQ',sortable:true},
{title:'创建人',field:'FULLNAME',formatter:function(v,r){return v+"["+r.USERNO+"]";}},
{field:'ID',title:'操作',formatter:function(val,row){return "<a href=\"javascript:void(0)\" class=\"easyui-splitbutton\""+   
    "data-options=\"menu:'#mm_"+val+"',iconCls:''\"onclick='view("+val+",\"\");'>查看</a>"+   
    "<div id=\"mm_"+val+"\" style=\"width:100px;\">"+
    "    <div data-options=\"iconCls:'icon-'\" onclick='add("+val+")'>编辑</div>"+   
    "    <div data-options=\"iconCls:'icon-cancel'\"style='color:red;' onclick='del("+val+")'>删除</div>"+   
    "</div>";}} ] ],
		onLoadSuccess:function(data){$.parser.parse();}
		});
	});
</script>
</head>
<body class="easyui-layout">
	<div  id="dgtb" style="padding:5px;height:auto">
		<form id="searchForm">
			<table>
				<tr>
					<td colspan="100%"><a href="javascript:void(0);" id="" class="easyui-linkbutton  "  iconCls="icon-eye" onclick="view();;"  plain="true">查看</a>
<a href="javascript:void(0);" id="" class="easyui-linkbutton  "  iconCls="icon-add" onclick="add();;"  plain="true">增加</a>
<a href="javascript:void(0);" id="" class="easyui-linkbutton  "  iconCls="icon-reload" onclick="$(datagrid).datagrid('reload');;"  plain="true">刷新</a>
<a href="javascript:void(0);" id="" class="easyui-linkbutton  "  iconCls="icon-search" onclick="dataGridSearch();" >查询</a>
<a href="javascript:void(0);" id="" class="easyui-linkbutton  "  iconCls="" onclick="cleanDataGridSearch();" >重置</a>
</td>
				</tr>
				<tr>
				<td>关键字</td><td><input type="text" name="KEY"></td>
				<td>需求类型</td><td><input class="easyui-combotree" id="XQLX_in" name="XQLX_in" value=""  data-options="multiple:false,value:'',disabled:false,separator:',',url:'/sys/parame/combotreeAjax?qryField=type&type=KHXQLX',valueField:'id',textField:'text',width:100,required:false,onChange:function (newVal,oldVal){},panelWidth:120">
</td>
				<td>状态</td><td><input class="easyui-combobox" id="STATE_in" name="STATE_in" value=""  data-options="multiple:false,value:'',disabled:false,separator:',',url:'/sys/parame/combobox?qryField=type&type=KHXQZT',valueField:'CNAME',textField:'CNAME',width:100,required:false,onChange:function (newVal,oldVal){}">

				</td><td>客户需求</td><td><input class="easyui-combotree" id="KHXQ_in" name="KHXQ_in" value=""  data-options="multiple:false,value:'',disabled:false,separator:',',url:'/sys/parame/combotreeAjax?qryField=type&type=KHXQ',valueField:'id',textField:'text',width:100,required:false,onChange:function (newVal,oldVal){},panelWidth:120">
</td>
			</tr>
			</table>
		</form>
	</div>
	<div region="center" border="false">
		<table id="datagrid"></table>
	</div>
</body>



返回顶部
顶部