0

我尝试在我的数据表上使用蒲公英数据表 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({

“网络错误:404 未找到 - http://localhost:8080/HRS/dandelion/datatables/filtering/filteringaddon.js

该表看起来不错,并且工作正常,我只是在列过滤器上遇到了问题。有人可以解释为什么会发生这种情况以及如何使用列过滤器吗?

4

1 回答 1

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/dandelion,现在它加载了 filteringaddon.js

于 2015-02-23T14:48:32.357 回答