我在使用带有“And”和“or”子句的过滤器时遇到问题。基本上我想获得任何带有文本“移动”或“测试”的用户故事
我正在尝试这样:
_createFilters:function(){
var filter = Ext.create('Rally.data.QueryFilter',
{
property: 'Name',
operator: 'contains',
value: 'Mobile'
}
);
filter = filter.or(Ext.create('Rally.data.QueryFilter',
{
property: 'Name',
operator: 'contains',
value: 'Testing'
}));
return filter.toString();
},
_makeDefectsStore:function(ref){
Ext.create('Rally.data.WsapiDataStore',{ // will fetch userstories that have defects
model: 'User Story',
limit: "Infinity",
context: {
project :'/project/xxxx',
projectScopeUp: false,
projectScopeDown: true
},
autoLoad: true,
fetch:['FormattedID','Name','Defects','Feature'],
filters: [this._createFilters()],
scope:this,
listeners: {
load: this._onAllDefectsLoaded,
scope: this
}
});
}
这里 filter 返回 null,否则返回所有用户故事而不进行过滤。请提供建议/修复