與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組件僅使用百分比來確定顏色,而許多拉力賽應用中使用的組件使用其他數據(如開始和結束日期)來確定它是否正在進行,完成,距離完成還有多遠,等等。你如何使組件顏色成爲你想要的顏色?我一直沒有找到方法 –