我有一个包含搜索结果的制表符。这是代码:
var table = new Tabulator("#json-table", {
layout:"fitDataFill",
//initialFilter:[{field:"title", type:"!=", value:"ignoreList.title"}],
ajaxURL:tabUrl,
ajaxResponse:function(url, params, response){
return Object.values(response);
},
columns:
[{title:"Title", field:"title", align:"center"},
{title:"Price", field:"price", align:"center"},
{title:"Shipping Cost", field:"shippingCost.shippingServiceCost.value", align:"center"},
{title:"Watch List", align:"center", cellClick:function(e, cell){
var data = cell.getData();
watchListArray.push(data);
localStorage.setItem("watchList", JSON.stringify(watchListArray));
},},
{title:"Ignore List", align:"center", cellClick:function(e, cell){
var data = cell.getData();
ignoreListArray.push(data);
localStorage.setItem("ignoreList", JSON.stringify(ignoreListArray));
},
},
{title:"Image", align:"center"},
],
});
我还有另一个包含忽略列表的制表器。这是代码:
ignoreListArray = JSON.parse(localStorage.getItem("ignoreList"));
var ignoreList = new Tabulator("#json-table", {
data:ignoreListArray,
layout:"fitDataFill",
columns:
[{title:"Title", field:"title", align:"center"},
{title:"Price", field:"price", align:"center"},
{title:"Shipping Cost", field:"shippingCost.shippingServiceCost.value", align:"center"},
{title:"Watch List", align:"center"},
{title:"Ignore List", align:"center"},
{title:"Image", align:"center"},
],
});
localStorage
如果用户单击他们想要忽略的行的忽略列表单元格,我将用于将搜索结果中的行存储在忽略列表制表器中。如果将一行放在忽略列表中,我想这样做,以便该行永远不会出现在未来的搜索结果中,直到它从忽略列表中删除。
是否有内置过滤器可以帮助我完成此操作?