fastadmin列表中字段换行显示
单一字段自动换行:
{field: 'admin_id', title: __('负责人'), operate: 'LIKE',cellStyle: {css: {"max-width": "300px","white-space":"pre-line","word-wrap":"break-word","word-break":"break-all"}}},
cellStyle: {css: {"max-width": "300px","white-space":"pre-line","word-wrap":"break-word","word-break":"break-all"}}
多个字段组合指定位置换行:
$str = '';
foreach ($json as $key2=>$value) {
$str .= '商品名称:'.$value['name'].',';
$str .= '购买数量:'.$value['num'].'册'.',';
$str .= '商品单价:'.$value['price'].',';
}
$str = mb_substr($str, 0, -1);
$list[$key]['order_info'] = $str;
{field: 'order_info', title: __('商品详情'), operate: 'LIKE',formatter: function (value){
var arr = value.split(',');
var html = '';
$.each(arr,function(index,values){
html += values+'<br/>';
});
return html;
}},

浙公网安备 33010602011771号