博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
thymeleaf+layui 展示table 报500
阅读量:4639 次
发布时间:2019-06-09

本文共 1475 字,大约阅读时间需要 4 分钟。

使用thymeleaf和layui的时候,使用layui的表格方法渲染,thymeleaf出现了渲染错误,报错信息如下:
org.thymeleaf.exceptions.TemplateProcessingException: Could not parse as expression: "
 
                {checkbox: true, fixed: true}
                , {field: 'originalFileName', title: '文件名', width: 400, sort: true}
                , {field: 'fileType', title: '文件类型', width: 100}
                , {field: 'fileSize', title: '文件大小', width: 110, sort: true}
                , {field: 'createTime', title: '上传时间', width: 170, sort: true}
                , {field: 'dpStatus', title: '数据处理状态', width: 122, templet: '#statusTpl', sort: true}
                , {field: 'updateTime', title: '数据处理完成时间', width: 170, templet: '#updateTimeTpl', sort: true}
                , {fixed: 'right', title: '操作', align: 'center', width: 300, toolbar: '#operating'}
 
            " (template: "textManagement" - line 125, col 22)
解决方案很简单:
 
 ,cols: [
[
 
      {field:'id', title: 'ID', sort: true}
      ,{field:'username', title: '用户名'} //width 支持:数字、百分比和不填写。你还可以通过 minWidth 参数局部定义当前单元格的最小宽度,layui 2.2.1 新增
      ,{field:'sex', title: '性别', sort: true}
      ,{field:'city', title: '城市'}
      ,{field:'sign', title: '签名'}
      ,{field:'classify', title: '职业', align: 'center'} //单元格内容水平居中
      ,{field:'experience', title: '积分', sort: true, align: 'right'} //单元格内容水平居中
      ,{field:'score', title: '评分', sort: true, align: 'right'}
      ,{field:'wealth', title: '财富', sort: true, align: 'right'}
 
    ]
]
也就是把cols后的[[ ]]变为
[
    [
    ]
]
因为[[…]]之间的表达式在thymeleaf被认为是内联表达式,所以渲染错误
---------------------
作者:rjkkaikai
来源:CSDN
原文:https://blog.csdn.net/rjkkaikai/article/details/80452128

转载于:https://www.cnblogs.com/wwqqnn123456/p/9970571.html

你可能感兴趣的文章
Linux Supervisor的安装与使用入门
查看>>
创建 PSO
查看>>
JasperReport报表设计4
查看>>
项目活动定义 概述
查看>>
团队冲刺04
查看>>
我的Python分析成长之路8
查看>>
泛型在三层中的应用
查看>>
SharePoint2010 -- 管理配置文件同步
查看>>
.Net MVC3中取得当前区域的名字(Area name)
查看>>
获得屏幕像素以及像素密度
查看>>
int与string转换
查看>>
adb命令 判断锁屏
查看>>
推荐一个MacOS苹果电脑系统解压缩软件
查看>>
1035等差数列末项计算
查看>>
CDMA鉴权
查看>>
ASP.NET MVC Identity 兩個多個連接字符串問題解決一例
查看>>
过滤器与拦截器区别
查看>>
USACO 1.5.4 Checker Challenge
查看>>
第二阶段站立会议7
查看>>
[18]Debian Linux Install GNU GCC Compiler and Development Environment
查看>>