如何过滤表中的多个变量? [英] How Can I Filter Multiple Variables In A Table?

查看:63
本文介绍了如何过滤表中的多个变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用查询/过滤器功能过滤掉同一字段的两个类别.

How can I use the query/filter function to filter out two categories of the same field.

当前可用于过滤已完成"任务的示例:

Example which currently works to filter "Completed" task:

var datasource = app.datasources.Project;
 datasource.query.filters.Status._notContains = 'Completed';
 datasource.load();

但是我想让它同时过滤已完成"和已取消"任务.

But I would like to have it filter both "Completed" AND "Canceled" tasks.

我尝试了这些,但是它们似乎没有用:

I tried these, but they didn't seem to work:

示例1

 var datasource = app.datasources.Project;
     datasource.query.filters.Status._notContains = 'Completed';
     datasource.query.filters.Status._notContains = 'Canceled';
     datasource.load();

示例2

var datasource = app.datasources.Project;
     datasource.query.filters.Status._notContains = 'Completed', 'Canceled';
     datasource.load();

任何帮助将不胜感激.谢谢!

Any help would be appreciated. Thanks!

推荐答案

要实现此目的,请使用以下方式使用_notIn而不是使用_notContains:

To achieve this, instead of using _notContains, please use _notIn the following way:

var datasource = app.datasources.Project;
var statuses = ['Completed', 'Canceled'];
     datasource.query.filters.Status._notIn = statuses;
     datasource.load();

请参考 官方文档 以获得更好,更详细的解释.我希望这会有所帮助!

Please refer to the official documentation for a better and more detailed explanation. I hope this helps!

这篇关于如何过滤表中的多个变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆