资源描述:
《GRID 表格的常用的使用方法》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、GRID表格的常用的使用方法:动态切换表格:varg;functioninitComplete(){ g=$("#maingrid").quiGrid({ columns:[ {display:'姓名',name:'name',align:'center', width:"30%"}, {display:'性别',name:'sex',align:'center',width:"20%"}, {display:'部门',name:
2、'deptName', align:'center',width:"30%"}, {display:'学历',name:'degree', align:'center',width:"20%"} ],data:testData,pageSize:10,rownumbers:true,checkbox:true,percentWidthMode:true, height:'100%',width:"100%" });}functionchangeGrid(){
3、 varcolumns=[ {display:'姓名',name:'name',align:'center', width:"10%"}, {display:'工作日期',name:'beginworkDate',align:'center',width:"20%"}, {display:'年龄',name:'age', align:'center',width:"10%"}, {display:'爱好',name:'hobby',
4、 align:'center',width:"20%"}, {display:'性别',name:'sex',align:'center',width:"10%"}, {display:'部门',name:'deptName', align:'center',width:"20%"}, {display:'学历',name:'degree', align:'center',width:"10%"}]; g.options.data=testDa
5、ta2; g.set('columns',columns); g.loadData();}动态设置urlvarg; functioninitComplete(){ g=$("#maingrid").quiGrid({ columns:[ {display:'姓名',name:'userName', align:'left',width:"18%"}, {display:'所属部门',name:'orgName', ali
6、gn:'left',width:"20%"}, {display:'性别',name:'userSex',align:'left',width:"10%"}, {display:'入职时间',name:'userEmployTime', align:'left', width:"20%"}, {display:'学历',name:'userEducation', align:'left', width:"20%"} ], sortName:'us
7、erId',rownumbers:true,checkbox:true,url:'',height:'100%',width:"100%",pageSize:5,percentWidthMode:true }); } functionloaddataHandler(){ g.setOptions({url:'<%=path%>/getUsersOfPager.action'}) g.loadData(); }综合实例:8、ght5">