Fastadmin控制table中字段的长度
时间:2023年07月02日
/来源:网络
/编辑:佚名
Fastadmin在列表展示中,如果像一些字段比如简介或备注之类的东西,内容太长,全部显示有点不友好,这里是限制长度,给个width(百分比或ps都行),字符过长显示…,鼠标放上去显示全部内容。
css复制代码{field: 'des', title: __('Des'), operate:false,cellStyle:function (value,row,index,field) {
return {
css: {
"min-width": "150px",
"white-space": "nowrap",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width":"300px"
}
};
},formatter:function (value,row,index,field) {
var span=document.createElement('span');
span.setAttribute('title',value);
span.innerHTML = value;
return span.outerHTML;
}},
css复制代码{field: 'des', title: __('Des'), operate:false,cellStyle:function (value,row,index,field) {
return {
css: {
"min-width": "150px",
"white-space": "nowrap",
"text-overflow": "ellipsis",
"overflow": "hidden",
"max-width":"300px"
}
};
},formatter:function (value,row,index,field) {
var span=document.createElement('span');
span.setAttribute('title',value);
span.innerHTML = value;
return span.outerHTML;
}},
新闻资讯 更多
- 【建站知识】查询nginx日志状态码大于400的请求并打印整行04-03
- 【建站知识】Python中的logger和handler到底是个什么?04-03
- 【建站知识】python3拉勾网爬虫之(您操作太频繁,请稍后访问)04-03
- 【建站知识】xpath 获取meta里的keywords及description的方法04-03
- 【建站知识】python向上取整以50为界04-03
- 【建站知识】scrapy xpath遇见乱码解决04-03
- 【建站知识】scrapy爬取后中文乱码,解决word转为html 时cp1252编码问题04-03
- 【建站知识】scrapy采集—爬取中文乱码,gb2312转为utf-804-03