繁体   English   中英

如何使用 Codeigniter 使用 Bootstarp 数据表搜索数据嵌套表数据?

[英]How to search data nested table data using Bootstarp datatables using Codeigniter?

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

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

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

如何做到这一点。

表的 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>

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

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

  2. 您进行服务器端搜索https://datatables.net/manual/server-side

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM