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',width:80,sortable:true},
{field:'userAccount',title:'用户帐号',width:100},
{field:'userPwd',title:'用户密码',width:80},
{field:'userTel',title:'手机',width:80},
{field:'userEmail',title:'邮箱',width:150},
{field:'userPayPwd',title:'支付密码',width:60},
{field:'userRegisterDate',title:'注册日期',width:60,sortable:true},
{field:'userGradeId',title:'会员等级',width:60,sortable:true},
{field:'userFlag',title:'用户标记',width: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 '' +
' ' +
'' +
'真实姓名: ' + rowData.userRealName + '
' +
'性 别: ' + rowData.userGender + '
' +
' ' +
'' +
'出生日期: ' + rowData.userBirthday + '
' +
'详细地址: ' + rowData.userAddress + '
' +
' '+
'' +
'积 分: ' + rowData.userPoints + '
' +
'消费金额: ' + rowData.userPaySum + '
' +
' '+
'' +
' 身份证: ' + rowData.userIdCard + '
' +
'收藏商品: ' + rowData.userCollectList + '
' +
' '+
'
';
},
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数据就不贴了