<script type="text/javascript">
&(function(){
$('#tabletool').datagrid({
title:"grid小工具",
url:'/tool/grantservice/export.do',
fit:true,
checkOnSelect:false,
toolbar:'tb',--上端工具栏
fitColumns:true,--设置为true列自动适应表格宽度以防止出现水平滚动,flase自动匹配大小
singleSelect:true,--单行选择
loadMsg:'正在努力为您加载数据',--展示语句
pagination:true,--显示最下端的分页工具栏
rownumbers:true,--显示行数1,2,3,4
pageSize:20,--读取分页数据条数,即调整pageSize每次向后台请求数据时的数据
pageList:[10,20,30],--可以调整煤业显示的数据,即调整pageSize每次向后台请求数据时的数据
sortName:'id',--初始化表格时依据的排序字段,必须和数据库中的字段名字相同
sortOrder:'asc',--正序
columns:[[
{field:'id',title:'编号',width:150},
{field:'id',title:'姓名',width:150,sortable:true},
{field:'id',title:'编号',width:150,sortable:true}
]]
});
});
function checkInputQuery(){
var employee_id=$('#employee_id').val();
$('#hidden_employee_id').val(employee_id);
var employee_name=$('#employee_name').val();
$('#hidden_employee_name').val(employee_name);
var employee_sex=$('#employee_sex').combox('getText');
$('#tabletool').datagrid('options').url='/tool/grantservice/export.do';
$('#tabletool').datagrid('load',{
employee_id:employee_id,
employee_name:employee_name,
employee_sex:employee_sex
});
}
function teset(){
$('#tab').find("input").val("");
}
</sctipt>
<div id="tb" style="width: auto;height:56px;">
<table id="tab" style="width:auto;height:auto;" cellspacing="0" border="0">
<tr>
<td>员工编号:
<input id="employee_id" name="employee_id" style="width:150px;">
<input id="hidden_employee_id" name="hidden_employee_id"type:"hidden" value="" style:"width:150px;">
</td>
<tr>
<td>员工姓名:
<input id="employee_name" name="employee_name" style="width:150px;">
<input id="hidden_employee_name" name="hidden_employee_name"type:"hidden" value="" style:"width:150px;">
</td>
<td>性别:
<input id="employee_sex" name="employee_sex" class="easyui-combobox" data-options="valueField:'id',textField:'text',panelMaxHeight:'200px',panelHeight:'0px',utl:'/tool/grantservice/dropDownList.do'"/>
</td>
<td>
<a id="search" class="easyui-linkbutton" iconCls="icon-search" onclick="checkInputQuery();">查询</a>
<a id="reset" class="easyui-linkbutton" iconCls="icon-reset" onclick="reset();">重置</a>
</td>
</tr>
</table>
</div>
<table id ="tabletool"></table>