【发布时间】:2016-03-30 13:39:31
【问题描述】:
我正在使用 Dojo dgrid,但在使用“or”语句进行 dstore 过滤时遇到问题。
var today = new Date();
today.setHours(0,0,0,0);
var start_date= new Date();
start_date.setDate(today.getDate() - 5);
start_date.setHours(0,0,0,0);
grid.set('collection', store.filter(
new store.Filter().or(
new store.Filter().gte('datefield1', start_date).lte('datefield1',today),
new store.Filter().gte('datefield2', start_date).lte('datefield2',today)
)
));
当它们分开时,这两个条件都很完美,但是当我将它们放在“或”过滤器中时,它就像“and”语句一样:两者都必须为“true”才能返回值。
如何使“或”语句在dojo dgrid dstore中正常工作?
【问题讨论】:
标签: collections dojo filtering dgrid dstore