我在alloy.collection中使用"dataFilter“
function filterFunction(collection) {
var lang = parseInt(Alloy.Globals.Language);
return collection.where({
LangID : lang,
CategoryID : categoryId
});
}它工作得很好,我的问题是我如何将这种方法与' or‘或' and’一起使用,我需要做一些像‘where categoryId="1“或categoryId="2”或categoryId=“3”这样的事情。
我在fetching中使用了query,它也工作得很好,但我想知道是否可以使用dataFilter函数来完成。
谢谢。
发布于 2015-03-19 21:07:29
下划线是默认安装的合金,我相信这应该可以工作
_.filter(Alloy.Globals.Language, function(i) {
return i.categoryId==="1" || i.categoryId==="2" || i.categoryId==="3"
});https://stackoverflow.com/questions/29073452
复制相似问题