table: 新增、加强和修复若干项

This commit is contained in:
贤心
2022-07-17 11:41:00 +08:00
parent ff3954e275
commit 506e6ff573
4 changed files with 72 additions and 50 deletions

View File

@@ -9,7 +9,7 @@
"id": "10001"
,"username": "杜甫123"
,"email": "test1@email.com"
,"sex": "<strong>男</strong>"
,"sex": "<strong style=\"color: red\">男</strong>"
,"city": "浙江杭州"
,"sign": "舍南舍北皆春水,但见群鸥日日来。花径不曾缘客扫,蓬门今始为君开。盘飧市远无兼味,樽酒家贫只旧醅。肯与邻翁相对饮,隔篱呼取尽余杯。"
,"experience": 7

View File

@@ -152,11 +152,13 @@ layui.use(['table', 'dropdown'], function(){
{type: 'checkbox', fixed: 'left'}
//,{type: 'numbers', fixed: 'left'}
,{field:'id', title:'ID', width:80, fixed: 'left', unresize: true, sort: true, totalRowText: '合计:'}
,{field:'username', title:'用户名', width:120, edit: 'text', templet: '#usernameTpl'}
,{field:'username', title:'用户名', width:120, edit: function(d){
return !d.LAY_DISABLED;
}, templet: '#usernameTpl'}
,{field:'email', minWidth: 160, title:'邮箱 <i class="layui-icon layui-icon-email"></i>', hide: 0, edit: 'text', templet: function(d){
return '<em>'+ layui.util.escape(d.email) +'</em>'
}}
,{field:'sex', title:'性别', width:80, edit: 'text', sort: true}
,{field:'sex', title:'性别', width:80, edit: 'text', sort: true, escape: false}
,{field:'city', title:'城市', width:120, templet: '#cityTpl', exportTemplet: function(d, obj){
//console.log(obj)
var td = obj.td(this.field); //获取当前 td

View File

@@ -228,16 +228,17 @@ layui.use('table', function(){
//,width: 900
//,height: 274
,cols: [[ //标题栏
{type: 'checkbox', LAY_CHECKED: true}
,{field: 'id', title: 'ID', width: 80, sort: true}
,{type: 'space', width: 100} //空列
,{field: 'username', title: '用户名', width: 120}
,{field: 'email', title: '邮箱', width: 150}
,{field: 'sign', title: '签名', width: 150}
,{field: 'sex', title: '性别', width: 80}
,{field: 'city', title: '城市', width: 100}
// ,{field: 'experience', title: '积分', width: 80, sort: true}
,{field: 'experience', title: '积分', width: 80, sort: true, totalRow: '{{= parseInt(d.TOTAL_NUMS) }}'}
//{type: 'space'},
{type: 'checkbox', LAY_CHECKED: true},
{field: 'id', title: 'ID', width: 80, sort: true},
{type: 'space', width: 100}, //空列
{field: 'username', title: '用户名', width: 120},
{field: 'email', title: '邮箱', width: 150},
{field: 'sign', title: '签名', minWidth: 150},
{field: 'sex', title: '性别', width: 80},
{field: 'city', title: '城市', width: 100},
//{field: 'experience', title: '积分', width: 80, sort: true},
{field: 'experience', title: '积分', width: 80, sort: true, totalRow: '{{= parseInt(d.TOTAL_NUMS) }}'}
]]
,data: [{
"id": "10001"