Grid 拉力网格加载事件未触发
我一直在努力确保lally.ui.grid.grid中的加载事件正在启动,因为我的网格没有过滤,所以出现了问题。我尝试调用方法myStore.setFilter()和myStore.load(),这两个方法正在启动,但我不能确定网格是否正常工作,因为第一次加载时,它会正确地进行过滤,但是当我更改下拉列表或组合框时,它不会 这是我加载myStore的方式:Grid 拉力网格加载事件未触发,grid,load,listener,rally,Grid,Load,Listener,Rally,我一直在努力确保lally.ui.grid.grid中的加载事件正在启动,因为我的网格没有过滤,所以出现了问题。我尝试调用方法myStore.setFilter()和myStore.load(),这两个方法正在启动,但我不能确定网格是否正常工作,因为第一次加载时,它会正确地进行过滤,但是当我更改下拉列表或组合框时,它不会 这是我加载myStore的方式: this.myStore=Ext.create("Rally.data.wsapi.Store",{
this.myStore=Ext.create("Rally.data.wsapi.Store",{
model:"Task",
autoLoad:true,
filters: myFilters,
listeners:{
load:function(myStore,myData,success){
if(!this.myGrid) //IT CREATES THE GRID FOR THE FIRST TIME
{
this._loadGrid(myStore)
console.log('Grid Created!');
// this.myStore.setFilter();
// this.myStore.load();
}
else
{
this.myStore.setFilter();
//this.myStore.load();
console.log('Grid reloaded!');
console.log(myFilters);
}
},
scope:this
},
fetch:["FormattedID","State","Iteration", "Release"]
}
)
}
这就是我加载myGrid的方式:
_loadGrid:function(myStoryStore){
this.myGrid = Ext.create("Rally.ui.grid.Grid",{
store:myStoryStore,
columnCfgs:["FormattedID","State","Iteration", "Release"],
listeners: {
load: function(myGridy){
console.log('myGrid did load!');
},
scope:this
}
});
this.add(this.myGrid);
}
下面是来自的David Thomas的一个示例,该示例使用存储传递到的
reconfigure
方法:\u myGrid.reconfigure(myStore)
谢谢,现在活动开始了。
Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
launch: function() {
var relComboBox = Ext.create('Rally.ui.combobox.ReleaseComboBox',{
listeners:{
ready: function(combobox){
//console.log('loaded release name', combobox.getRecord().get('Name')); //getRecord() returns currently selected item
var releaseRef = combobox.getRecord().get('_ref');
this._loadStories(releaseRef);
//console.log('what is this', this);
},
select: function(combobox){
var releaseRef = combobox.getRecord().get('_ref');
this._loadStories(releaseRef);
},
scope: this
}
});
this.add(relComboBox);
},
_loadStories: function(releaseRef){
console.log('loading stories for ', releaseRef);
var myStore = Ext.create('Rally.data.WsapiDataStore',{
model: 'User Story',
autoLoad:true,
fetch: ['Name','ScheduleState','FormattedID'],
filters:[
{
property : 'Release',
operator : '=',
value : releaseRef
}
],
listeners: {
load: function(store,records,success){
console.log("loaded %i records", records.length);
this._updateGrid(myStore);
},
scope:this
}
});
},
_createGrid: function(myStore){
console.log("load grid", myStore);
this._myGrid = Ext.create('Ext.grid.Panel', {
title: 'Stories by Release',
store: myStore,
columns: [
{text: 'ID', dataIndex: 'FormattedID', flex: 1},
{text: 'Story Name', dataIndex: 'Name', flex: 2},
{text: 'Schedule State', dataIndex: 'ScheduleState', flex: 2}
],
height: 400
});
this.add(this._myGrid);
},
_updateGrid: function(myStore){
if(this._myGrid === undefined){
this._createGrid(myStore);
}
else{
this._myGrid.reconfigure(myStore);
}
}
});