关闭

easyui datagrid之editor扩展

标签: easyuidatagrideditor
66人阅读 评论(0) 收藏 举报
分类:

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.效果图




0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:134次
    • 积分:20
    • 等级:
    • 排名:千里之外
    • 原创:2篇
    • 转载:0篇
    • 译文:0篇
    • 评论:0条
    文章分类
    文章存档