我尝试在我的数据表上使用蒲公英数据表taglib,这是我的代码:
<%@ taglib prefix="datatables" uri="http://github.com/dandelion/datatables" %>
<datatables:table row="row" id="interviewTable" url="/admin/interviews-loadtable" paginationType="full_numbers" cssClass="display table table-striped"
stateSave="false" serverSide="true" processing="true" autoWidth="true" pageable="true" filterPlaceholder="head_after" dom="l0frtip">
<datatables:callback type="draw" function="bela"/>
<datatables:column title="Candidate" property="candidate.name" filterable="true" filterType="input" filterMinLength="1" filterCssClass="search_init text"/>
<datatables:column title="Title" property="job.title" filterable="true" filterType="input" filterMinLength="1" filterCssClass="search_init text"/>
<datatables:column title="Date" property="date" filterable="true" filterType="select" filterCssClass="search_init text datetime filter_change"/>
<datatables:column title="Status" property="status" filterable="true" filterType="select" filterCssClass="search_init select_status"/>
<datatables:column title="Buttons" filterable="false" renderFunction="buttons" cssCellClass="center buttons" sortable="false" cssStyle="width: 100px;"/>
</datatables:table>
当我使用filterable =“true”进行列过滤时,会生成以下代码:
<tr role="row">
<th rowspan="1" colspan="1">Candidate</th>
<th rowspan="1" colspan="1">Title</th>
<th rowspan="1" colspan="1">Date</th>
<th rowspan="1" colspan="1">Status</th>
<th style="width: 100px;" rowspan="1" colspan="1">Buttons</th>
</tr>
我希望能产生类似这样的东西
<tr role="row">
<input class="search_init text" type="text">
<input class="search_init text" type="text">
<input class="search_init text datetime" type="text">
<input class="search_init select_status" type="text">
<th></th>
</tr>
在控制台中我遇到这样的错误:
TypeError:oTable_interviewTable.dataTable(...)。columnFilter不是 功能 oTable_interviewTable.dataTable(oTable_interviewTable_params).columnFilter({
和
“NetworkError:404 Not Found - http://localhost:8080/HRS/dandelion/datatables/filtering/filteringaddon.js“
该表看起来很好,它工作正常,我只有列过滤器有问题。有人可以解释为什么会发生这种情况以及如何使用列过滤器?
答案 0 :(得分:2)
这个捆绑帮助了我:
{
"bundle" : "any-name",
"assets": [
{
"name": "dandelion-filtering", <= don't change this name, in order to override the asset
"version": "1.6.1", <= doesn't matter (yet)
"type": "js",
"locations": {
"webapp": "/your-asset-directory-inside-your-webapp/your-modified-filteringaddon.js"
}
}
]
}
我输入src / main / resources /蒲公英,现在它加载filteringaddon.js