条件搜索结果

Conditional Search Results

我正在创建一个 'Kiosk',用户可以在其中登录和注销。 我被困在注销组件上。

我想要一个 table 只有 returns 最终用户搜索后未退出的访问者。

我的搜索框具有以下属性:

值:

@datasource.query.filters.fullname._startsWith

值更改时:

if (widget.value === null || (widget.value).length === 0){
    widget.datasource.unload();
} else {
    widget.datasource.load();
}

我对这个和整个 JS 都不熟悉。如何过滤搜索以仅包含尚未注销的用户?

根据评论中的建议,您需要在加载数据源之前添加 widget.datasource.query.filters.signedout._equals = false; 行。但是你应该在卸载时再做一个改变。

这是完整的代码。

if (widget.value === null || (widget.value).length === 0){
    widget.datasource.unload();
    widget.datasource.load();
} else {
    widget.datasource.unload();
    widget.datasource.query.filters.signedout._equals = false;
    widget.datasource.load();
}

此处unload()将卸载以前的数据,load()将重新加载。现在,在重新加载时您可以传递多个过滤器,因此它只重新加载过滤后的记录。