与Rally percent done by story count and plan estimate color coding algorithm相关,但在这里询问未答复的部分。拉力赛完成百分比组件
SDK 2.0中的Percent Done ui component根据rally使用的算法(它仅基于百分比的颜色代码)不着色。有没有什么方法可以提供颜色编码功能或渲染功能来改变这个功能与拉力赛的阵容?谢谢!
[编辑] - 试图重写现有的功能,而不使用百分比进行生成UI组件
Ext.define('Custom.PercentDone', {
requires: ['Rally.ui.renderer.template.progressbar.PortfolioItemPercentDoneTemplate', 'Rally.util.HealthColorCalculator'],
extend : 'Rally.ui.PercentDone',
alias : 'widget.cpercentdone',
config: {
record: null
},
constructor: function(config) {
this.initConfig(config);
config = this.config;
this.renderTpl = Ext.create('Custom.renderer.template.progressbar.PercentDoneTemplate', {
calculateColorFn: Ext.bind(function(recordData) {
console.log('called my custom coloring fn');
var colorObject = Rally.util.HealthColorCalculator.calculateHealthColorForPortfolioItemData(config.record, config.percentDoneName);
return colorObject.hex;
}, this)
});
this.renderData = config;
this.mergeConfig(config);
this.callParent([this.config]);
}
});
App.down('#subContainer').add({
xtype: 'cpercentdone',
record: item,
useStoryCount: !App.estimate
});
我不能完全得到正常的工作记录 - 我想传递的信息, calculateHealthColorForPortfolioItemData函数,但我不能完全弄清楚什么参数正在传递和在哪里,所以我不知道该设置什么和在哪里。
我也尝试使用Ext.override:
var percentDone = Ext.create('Rally.ui.PercentDone', {
record: item,
percentDoneName: 'PercentDoneByStoryCount'
});
var tpl = percentDone.renderTpl;
tpl.calculateColorFn = function(recordData) {
var colorObject = Rally.util.HealthColorCalculator.calculateHealthColorForPortfolioItemData(percentDone.record, percentDone.percentDoneName);
return colorObject.hex;
};
Ext.override(percentDone, {
renderTpl: tpl
});
App.down('#subContainer').add(percentDone);
在SDK中的代码应该是一样的代码在生产中。 (他们共享相同的代码)是否存在一种情况,其中一种颜色与另一种颜色不同? 这就是说,你可以使组件颜色的酒吧,但是你喜欢。 –
已完成百分比的UI组件仅使用百分比来确定颜色,而许多拉力赛应用中使用的组件使用其他数据(如开始和结束日期)来确定它是否正在进行,完成,距离完成还有多远,等等。你如何使组件颜色成为你想要的颜色?我一直没有找到方法 –