easyui datagrid之editor扩展

1.前台代码

<pre name="code" class="html">	<th data-options="field:'xbuscode',align:'center',editor:{type:'combogrid',options:{
            					panelWidth:113,
            					panelHeight:180,
            					textField:'buscode',
            					columns:[[
            						{field:'buscode',title:'车辆自编号'},
            						{field:'driverrestmap',title:'休位'}
            					]],
            					onShowPanel:function(){
            						var selrow=$('#adddriverrestmapref').datagrid('getSelected');
            						$(this).combogrid({
										url:'wiDriverrestmaprefController.do?getbuscode&pid='+selrow.xdriverrestid,
									});
            					},
            					onHidePanel:function(){
										var opt=$('#adddriverrestmapref').datagrid('options');
										var selrow = $(this).combogrid('grid').datagrid('getSelected');
										var buscode =selrow.buscode;
										var driverrestmap = selrow.driverrestmap;
										$('#adddriverrestmapref').datagrid('updateRow',{
					  							index:opt.SelectCellRow,
					  							row:{
					  								xbuscode:buscode,
					  								xdriverrestmap:driverrestmap
					  							}
					  						});
									}
            				
            				}
            				}
            				">班组1车辆自编号</th>



2.onShowPanel方法后台数据数据获取

@RequestMapping(params = "getbuscode")
	@ResponseBody
	public void getbuscode(String pid ,HttpServletRequest request ,HttpServletResponse response){
		String ssql="select distinct * from (select  buscode , driverrestmap1 driverrestmap from wi_driverrestgroupd where pid =? and buscode is not null and buscode<>'' and buscode<>'轮休' and driverrestmap1 is not null and driverrestmap1 <>'' union all select  buscode , driverrestmap2 driverrestmap from wi_driverrestgroupd where pid =? and buscode is not null and buscode<>'' and buscode<>'轮休' and driverrestmap2 is not null and driverrestmap2<>'') ss";
		SqlRowSet rs =this.systemService.findForJdbcSet(ssql,pid,pid);
		PrintWriter pw = null;
		try {
			pw = response.getWriter();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		pw.write(this.systemService.SqlRowSetToJosn(rs));
		pw.flush();
	}
}
3.效果图




阅读更多
文章标签: easyui datagrid editor
个人分类: easyui
上一篇easyui datagrid 的使用
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭