亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

數據表搜索功能不會根據多個值過濾表

數據表搜索功能不會根據多個值過濾表

慕俠2389804 2023-06-15 16:11:56
我正在用數據表構建一個 excel 過濾器。我收集了表行的值并將其推送到過濾器下拉列表中。數據表代碼:datatable = $("#datatable").DataTable({? ? ? searching: true,? ? ? columns: [? ? ? ? { title: "itemID", defaultContent: "" },? ? ? ? { title: "Name", defaultContent: "" },? ? ? ? { title: "Age", defaultContent: "" },? ? ? ? { title: "Country", defaultContent: "" },? ? ? ? { title: "E-mail", defaultContent: "" },? ? ? ? { title: "Address", defaultContent: "" },? ? ? ? { title: "Fax", defaultContent: "" },? ? ? ? { title: "Employee ID", defaultContent: "" },? ? ? ? { title: "Occupation", defaultContent: "" },? ? ? ? { title: "Phone", defaultContent: "" },? ? ? ? { title: "", defaultContent: "" }? ? ? ],? ? ? // Initialize the datatable header.? ? ? initComplete: function () {? ? ? ? var table = this.api();? ? ? ? var headers = $(this[0]).find("thead tr").children();? ? ? ? // For each header, append an input so it can be used for filtering the table.? ? ? ? $(headers).each(? ? ? ? ? column =>? ? ? ? ? ? (table? ? ? ? ? ? ? .column(column)? ? ? ? ? ? ? // Append the filter div and the arrow down icon.? ? ? ? ? ? ? .header().innerHTML += `<i class="arrow down"></i><div class="filter"></div>`)? ? ? ? );? ? ? }? ? });過濾表幾次后,它停止過濾表。我很確定搜索數據表功能有問題,但我不明白確切的問題是什么(沒有錯誤消息)。如果有人可以提供幫助,我會很高興。謝謝你!
查看完整描述

1 回答

?
陪伴而非守候

TA貢獻1757條經驗 獲得超8個贊

這里是答案:

1:取消選中Item ID列中的8

2:勾選Name中的name8選項

您看到的問題是沒有顯示帶有 name8 的行嗎?

列搜索是 AND 搜索,因此如果一列搜索過濾掉一行,另一列中的列搜索將不會顯示該行。如果這是您正在尋找的,可以創建一個搜索插件來執行 OR 搜索。


查看完整回答
反對 回復 2023-06-15
  • 1 回答
  • 0 關注
  • 133 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號