1
您好我想必須包含2個過濾器首先要篩選基於包含「自郵」字名的關鍵字數據的功能,下一個是基於在迭代框中。我試着做,但網格顯示沒有數據我使用的代碼:排序和過濾數據
Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
grid: null,
launch: function() {
var filters = [];
var timeboxScope = this.getContext().getTimeboxScope();
if(timeboxScope) {
filters.push(timeboxScope.getQueryFilter());
}
this.getFilteredStoryModel(filters);
},
onTimeboxScopeChange: function(newTimeboxScope) {
var newFilters = [];
var updatedTimeboxScope = this.getContext().getTimeboxScope();
if (this.grid) {
this.grid.destroy();
}
if (updatedTimeboxScope) {
newFilters.push(newTimeboxScope.getQueryFilter());
}
this.getFilteredStoryModel(newFilters);
},
getFilteredStoryModel:function(queryFilters){
Ext.create('Rally.data.wsapi.Store', {
fetch: ['FormattedID','Name','Owner','ScheduleState'],
model:"User Story",
filters: queryFilters,
autoLoad:true,
listeners:{
load:function(myStore,myData,success){
console.log("got data:",myStore,myData,success);
//the data is got and store in myStore if success. and the _loadTagSummary is called with the myStore pass into it
this.displaydata(myStore);
},
scope:this
},
});
},
displaydata:function(mystorystore){
this.grid = this.add({
xtype: 'rallygrid',
model: mystorystore,
columnCfgs: [
'FormattedID',
'Name',
'Owner'
],
storeConfig: {
filters: [
{
property: 'Name',
operator: '=',
value: 'From Mail'
}
]
}
});
}
});
感謝您的幫助
是否可以根據關鍵字進行過濾「從郵件中」的名字? – Jonathan
當然,這是什麼_getFilters功能正在做什麼。它包含Name = From Mail過濾器,然後包含一個時間框過濾器(如果可用)。你可以嘗試更改爲包含以及而非=接線員名精確匹配的... –
是運營商,我應該把什麼?抱歉,很新的反彈 – Jonathan