Rally 集合功能和汇总的网格
我正在尝试制作一个网格,该网格同时显示一个汇总(汇总及其子项) 当我将网格的模型设置为“PortfolioItem/Feature”时,第一个单独的查询会起作用,但当我将模型更改为“PortfolioItem”时,网格不会显示任何数据,并且将OR添加到过滤器中肯定不会有帮助Rally 集合功能和汇总的网格,rally,Rally,我正在尝试制作一个网格,该网格同时显示一个汇总(汇总及其子项) 当我将网格的模型设置为“PortfolioItem/Feature”时,第一个单独的查询会起作用,但当我将模型更改为“PortfolioItem”时,网格不会显示任何数据,并且将OR添加到过滤器中肯定不会有帮助 var filter = Ext.create('Rally.data.QueryFilter', { property: 'Parent.ObjectID', operator: '=', valu
var filter = Ext.create('Rally.data.QueryFilter', {
property: 'Parent.ObjectID',
operator: '=',
value: id
});
filter = filter.or({
property: 'ObjectID',
operator: '=',
value: id
});
我是不是走错了路?我知道在使用PortfolioItem模型之前,我已经制作了一个功能和汇总的网格,但我一直在根据开始日期和结束日期进行筛选。这里是一个简单的网格,显示所有投资组合项目类型、主题、计划、功能,其中
model: 'PortfolioItem'
如果我只获取一个特定于一种PI类型的属性,例如PortfolioItem/Feature上的UserStories:
fetch: ['FormattedID','Name']
代码中有类似的内容:
StoryCount: feature.get('UserStories').Count
当网格不显示任何数据时,我将看到与您报告的结果相同的结果
<!DOCTYPE html>
<html>
<head>
<title>PIGridExample</title>
<script type="text/javascript" src="/apps/2.0rc1/sdk.js"></script>
<script type="text/javascript">
Rally.onReady(function () {
Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
launch: function() {
Ext.create('Rally.data.WsapiDataStore', {
model: 'PortfolioItem',
fetch: ['FormattedID','Name'],
pageSize: 100,
autoLoad: true,
listeners: {
load: this._onDataLoaded,
scope: this
}
});
},
_onDataLoaded: function(store, data) {
var records = [];
Ext.Array.each(data, function(record) {
records.push({
Name: record.get('Name'),
FormattedID: record.get('FormattedID'),
});
});
this.add({
xtype: 'rallygrid',
store: Ext.create('Rally.data.custom.Store', {
data: records
}),
columnCfgs: [
{
text: 'Name', dataIndex: 'Name', flex: 1
},
{
text: 'FormattedID', dataIndex: 'FormattedID'
}
]
});
}
});
Rally.launchApp('CustomApp', {
name:"PIGridExample"
//parentRepos:""
});
});
</script>
<style type="text/css">
.app {
/* Add app styles here */
}
</style>
</head>
<body></body>
</html>
猪笼草
Rally.onReady(函数(){
Ext.define('CustomApp'{
扩展:“Rally.app.app”,
组件CLS:“应用程序”,
启动:函数(){
Ext.create('Rally.data.WsapiDataStore'{
型号:“PortfolioItem”,
获取:['FormattedID','Name'],
页面大小:100,
自动加载:对,
听众:{
加载:这个。加载后,
范围:本
}
});
},
_onDataLoaded:函数(存储、数据){
var记录=[];
Ext.Array.each(数据、函数(记录){
记录。推送({
Name:record.get('Name'),
FormattedID:record.get('FormattedID'),
});
});
这个。添加({
xtype:“rallygrid”,
store:Ext.create('Rally.data.custom.store'{
数据:记录
}),
专栏CFGS:[
{
文本:“名称”,数据索引:“名称”,flex:1
},
{
文本:“FormattedID”,数据索引:“FormattedID”
}
]
});
}
});
Rally.launchApp('CustomApp'{
名称:“PIGridExample”
//家长报告:“
});
});
.app{
/*在此处添加应用程序样式*/
}
以下是一个应用程序示例,其中包含一系列功能及其用户商店:
Ext.define('CustomApp', {
extend: 'Rally.app.App',
componentCls: 'app',
launch: function() {
Ext.create('Rally.data.WsapiDataStore', {
model: 'PortfolioItem/Feature',
fetch: ['FormattedID','Name','UserStories'],
pageSize: 100,
autoLoad: true,
listeners: {
load: this._onDataLoaded,
scope: this
}
});
},
_createGrid: function(features) {
this.add({
xtype: 'rallygrid',
store: Ext.create('Rally.data.custom.Store', {
data: features,
pageSize: 100
}),
columnCfgs: [
{
text: 'Formatted ID', dataIndex: 'FormattedID', xtype: 'templatecolumn',
tpl: Ext.create('Rally.ui.renderer.template.FormattedIDTemplate')
},
{
text: 'Name', dataIndex: 'Name'
},
{
text: 'Story Count', dataIndex: 'StoryCount'
},
{
text: 'User Stories', dataIndex: 'UserStories',
renderer: function(value) {
var html = [];
Ext.Array.each(value, function(userstory){
html.push('<a href="' + Rally.nav.Manager.getDetailUrl(userstory) + '">' + userstory.FormattedID + '</a>')
});
return html.join(', ');
}
}
]
});
},
_onDataLoaded: function(store, data){
var features = [];
var pendingstories = data.length;
Ext.Array.each(data, function(feature) {
var f = {
FormattedID: feature.get('FormattedID'),
Name: feature.get('Name'),
_ref: feature.get("_ref"),
StoryCount: feature.get('UserStories').Count,
UserStories: []
};
var stories = feature.getCollection('UserStories');
stories.load({
fetch: ['FormattedID'],
callback: function(records, operation, success){
Ext.Array.each(records, function(story){
f.UserStories.push({_ref: story.get('_ref'),
FormattedID: story.get('FormattedID')
});
}, this);
--pendingstories;
if (pendingstories === 0) {
this._createGrid(features);
}
},
scope: this
});
features.push(f);
}, this);
}
});
Ext.define('CustomApp'{
扩展:“Rally.app.app”,
组件CLS:“应用程序”,
启动:函数(){
Ext.create('Rally.data.WsapiDataStore'{
型号:“PortfolioItem/Feature”,
获取:['FormattedID','Name','UserStories'],
页面大小:100,
自动加载:对,
听众:{
加载:这个。加载后,
范围:本
}
});
},
_createGrid:函数(功能){
这个。添加({
xtype:“rallygrid”,
store:Ext.create('Rally.data.custom.store'{
数据:特征,
页面大小:100
}),
专栏CFGS:[
{
text:'Formatted ID',dataIndex:'FormattedID',xtype:'templatecolumn',
tpl:Ext.create('Rally.ui.renderer.template.FormattedIDTemplate')
},
{
文本:“名称”,数据索引:“名称”
},
{
文本:“故事计数”,数据索引:“故事计数”
},
{
文本:“用户故事”,数据索引:“用户故事”,
渲染器:函数(值){
var html=[];
Ext.Array.each(值、函数(用户故事){
html.push(“”)
});
返回html.join(',');
}
}
]
});
},
_onDataLoaded:函数(存储、数据){
var特征=[];
var pendingstories=data.length;
Ext.Array.each(数据、函数(功能){
变量f={
FormattedID:feature.get('FormattedID'),
名称:feature.get('Name'),
_ref:feature.get(“\u ref”),
StoryCount:feature.get('UserStories').Count,
用户故事:[]
};
var stories=feature.getCollection('UserStories');
故事·负载({
获取:['FormattedID'],
回调:函数(记录、操作、成功){
Ext.Array.each(记录、函数(故事){
f、 UserStories.push({u-ref:story.get(''u-ref'),
FormattedID:story.get('FormattedID')
});
},这个);
--悬而未决;
如果(挂起状态===0){
这是.\u createGrid(功能);
}
},
范围:本
});
特征:推送(f);
},这个);
}
});
如果功能集仅包含在单个子项引用中,上述功能将如何工作?