【问题标题】:How to search data nested table data using Bootstarp datatables using Codeigniter?如何使用 Codeigniter 使用 Bootstrap 数据表搜索数据嵌套表数据?
【发布时间】:2016-04-30 13:04:30
【问题描述】:

我有一个使用引导数据表创建的表,当我搜索数据时,它在表中工作。

但我在每一行都创建了一个嵌套表。当我单击特定行上的“显示客户”链接时,将显示此嵌套表。

现在,当我从父表中搜索元素时,它只搜索父表元素,我也想搜索子表元素。

如何做到这一点。

表格的HTML代码:

    <table class="table table-hover" id="table2">
            <thead>
              <tr>
                <th>ID</th>
    <th>Action</th>
              </tr>
            </thead>
            <tbody>
      <tr>
                <td>1</td>
    <a href="#" onClick="project_list('<?=$item->bldr_ID;?>',0)">
                    details
                  </a>
                </td>
              </tr>


//Here generate another child table when I click details link (will call "project_list" function using ajax)

// Now want to search element both parent and child elements from parent table search column

    </tbody>
          </table>

【问题讨论】:

    标签: javascript jquery html twitter-bootstrap codeigniter


    【解决方案1】:

    数据表只能搜索表中的本地事物。你有两个选择:

    1. 您在创建过程中将 «project_list» 数据写入表中并隐藏它们。

    2. 你在服务器端搜索https://datatables.net/manual/server-side

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-12-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多