• easyui 的 DataGrid View 使用



    easyui真是后台人员的宝呀,让不会前台的程序员,不用再用那些自己看着都恶心的表格了!偷笑


    今天来说说easyui datagrid 的 数据表格详细展示表格,这个有趣多了!


    先上图



    然后是代码

    $('#tt').datagrid({
    				title:'浏览模式',
    				remoteSort:false,
    				nowrap:false,
    				fitColumns:true,
    				sortName: "id",
    				sortOrder: "desc", 
    				pageSize: 20,
    				pageList: [5, 10, 15, 20],
    				pagination: true,
    				url:'getMemberAllList.do',
    				columns:[[
    					{field:'id',title:'ID',80,sortable:true},
    					{field:'userAccount',title:'用户帐号',100},
    					{field:'userPwd',title:'用户密码',80},
    					{field:'userTel',title:'手机',80},
    					{field:'userEmail',title:'邮箱',150},
    					{field:'userPayPwd',title:'支付密码',60},
    					{field:'userRegisterDate',title:'注册日期',60,sortable:true},
    					{field:'userGradeId',title:'会员等级',60,sortable:true},
    					{field:'userFlag',title:'用户标记',60},
    					
    			
    					{field:'userRealName',title:'真实姓名', hidden: 'true'},
    					{field:'userGender',title:'性别', hidden: 'true'},
    					{field:'userBirthday',title:'出生日期', hidden: 'true'},
    					{field:'userAddress',title:'详细地址', hidden: 'true'},
    					{field:'userPoints',title:'积分', hidden: 'true'},
    					{field:'userPaySum',title:'消费金额', hidden: 'true'},
    					{field:'userIdCard',title:'身份证', hidden: 'true'},
    					{field:'userCollectList',title:'收藏表', hidden: 'true'},
    					{field:'userImageMinHref',title:'头像', hidden: 'true'}
    					
    					
    					
    				]],
    				view: detailview,
    				detailFormatter: function(rowIndex, rowData){
    					return '<table cellspacing="30px"><tr>' +
    							'<td rowspan=2 style="border:0"><img src="<%=request.getContextPath()%>/images/header/' + rowData.userImageMinHref + '.jpg" style="height:50px;"></td>' +
    							'<td style="border:0">' +
    							'<p><b style=" color:blue ">真实姓名:</b> ' + rowData.userRealName + '</p>' +
    							'<p><b style=" color:blue ">性   别:</b> ' + rowData.userGender + '</p>' +
    							'</td>' +
    							'<td style="border:0">' +
    							'<p><b style=" color:blue ">出生日期:</b> ' + rowData.userBirthday + '</p>' +
    							'<p><b style=" color:blue ">详细地址:</b> ' + rowData.userAddress + '</p>' +
    							'</td>'+
    							'<td style="border:0">' +
    							'<p><b style=" color:blue ">积   分:</b> ' + rowData.userPoints + '</p>' +
    							'<p><b style=" color:blue ">消费金额:</b> ' + rowData.userPaySum + '</p>' +
    							'</td>'+
    							'<td style="border:0">' +
    							'<p><b style=" color:blue "> 身份证:</b> ' + rowData.userIdCard + '</p>' +
    							'<p><b style=" color:blue ">收藏商品:</b> ' + rowData.userCollectList + '</p>' +
    							'</td>'+
    							'</tr></table>';
    				},
    				toolbar: /* '#selectToolbar' */ [{
    					disabled: 'true',
    					iconCls: 'icon-add',
    					text: '浏览模式',
    					handler: function(){
    						
    						
    	                       $('#dd').panel('close'); 
    	                       $('#tt').datagrid('getPanel').panel('open');
    					}
    				},'-',{
    					
    					iconCls: 'icon-edit',
    					text: '编辑模式',
    					handler: function(){
    						
    						$('#tt').datagrid('getPanel').panel('close');
    						$('#dd').panel('open');					
    						
    					}
    				}],
    	            onBeforeLoad: function () {
    	            	$('#pp').panel('open');
    	                start();
    	            },
    	            onLoadSuccess: function () {
    	            	$('#pp').panel('close');
    	            }
    
    				
    			});
    });
    
    用spring发送json数据就不贴了

  • 相关阅读:
    eclipse中的Invalid text string (xxx).
    在jsp文件中出现Unknown tag (c:out)
    eclipse 界面复原
    ecilpse 纠错插件
    Multiple annotations found at this line:- The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path
    Port 8080 required by Tomcat v9.0 Server at localhost is already in use. The server may already be running in another process, or a system process may be using the port.
    调用第三方https接口
    调用第三方http接口
    创建带值枚举
    spring整合redis之Redis配置文件
  • 原文地址:https://www.cnblogs.com/kiwifly/p/4435864.html
Copyright © 2020-2023  润新知