Data tables in Spring Boot thymleaf apps

落爺英雄遲暮 提交于 2021-02-05 09:24:29

问题


How do I add edit and delete columns in this table?

Here is my JavaScript code...

$(document).ready( function () {
     var table = $('#employeesTable').DataTable({
            "sAjaxSource": "/employees",
            "sAjaxDataProp": "",
            "order": [[ 0, "asc" ]],
            "aoColumns": [
                  { "mData": "id"},
                  { "mData": "name" },
                  { "mData": "capital" },
            ]
     })
});

Here is my HTML page...

<table id="employeesTable" class="display">
<thead>
    <tr>
        <th>Id</th>
        <th>Name</th>
        <th>Capital</th>
    </tr>
</thead>
</table>

来源:https://stackoverflow.com/questions/63864744/data-tables-in-spring-boot-thymleaf-apps

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!