Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 在页面呈现时添加列的Thymeleaf Dandelion数据表_Jquery_Spring Boot_Datatable_Thymeleaf_Dandelion - Fatal编程技术网

Jquery 在页面呈现时添加列的Thymeleaf Dandelion数据表

Jquery 在页面呈现时添加列的Thymeleaf Dandelion数据表,jquery,spring-boot,datatable,thymeleaf,dandelion,Jquery,Spring Boot,Datatable,Thymeleaf,Dandelion,我正在使用1.0.1版本的蒲公英百里香。下面是我的蒲公英数据表的定义。表中有3个固定列,后面是在页面呈现时添加的一些列 <table class="reportTable" dt:table="true" dt:pageable="false" dt:filterable="false" dt:processing="false" dt:serverside="false"> <thead> <tr> <t

我正在使用1.0.1版本的蒲公英百里香。下面是我的蒲公英数据表的定义。表中有3个固定列,后面是在页面呈现时添加的一些列

<table class="reportTable" dt:table="true" dt:pageable="false" dt:filterable="false" dt:processing="false" dt:serverside="false">
    <thead>
        <tr>
            <th>Day</th>
            <th>No of calls</th>
            <th>Duration</th>
            <th:block th:each="sb : ${timePeriodColumns}">
                <th th:text="${sb}">x</th>
            </th:block>
        </tr>
    </thead>
    <tbody>
        <tr th:each="sb : ${monthCallsByTimePeriod}">
            <td th:text="${sb.day}">x</td>
            <td th:text="${sb.numberOfCallsPerDay}">x</td>
            <td th:text="${sb.callDurationPerDayInMinutes}">x</td>

            <th:block th:each="tp : ${sb.dataForTimePeriod}">
                <td th:text="${tp.numberOfCalls}">x</td>
                <td th:text="${tp.callDurationInMinutes}">x</td>
            </th:block>
        </tr>
    </tbody>
</table>

我做错了什么?如何在渲染时将一些列添加到Dandelion Datatable中?

作为一种解决方法,我已将前三列添加到
timePeriodColumns
列表中,并将其留给Thymeleaf渲染
中的所有列:

<thead>
    <tr>
        <th th:each="sb : ${timePeriodColumns}" th:text="${sb}">x</th>
    </tr>
</thead>

x
我怀疑使用有问题,但我无法证明这一点。无论如何,这解决了我的问题

<thead>
    <tr>
        <th th:each="sb : ${timePeriodColumns}" th:text="${sb}">x</th>
    </tr>
</thead>