我正在尝试在 TFS 2012 Web Access 中添加指向工作项控件的链接。然而,我看到的是我正在定义的函数bind
并且_init
在页面生命周期的任何时候都没有被调用。
这是一些精简的代码:
TFS.module("TFS.WA.ProofOfConcept",
[
"TFS.WorkItemTracking.Controls",
"TFS.WorkItemTracking",
"TFS.Core"
],
function () {
var WITOM = TFS.WorkItemTracking,
WITCONTROLS = TFS.WorkItemTracking.Controls,
delegate = TFS.Core.delegate,
moduleBaseUrl = TFS.getModuleBase("TFS.WA.ProofOfConcept");
function ProofOfConcept(container, options, workItemType) {
this.baseConstructor.call(this, container, options, workItemType);
}
ProofOfConcept.inherit(WITCONTROLS.WorkItemControl, {
_control: null,
// Initialize the control UI without data (in "blank" state).
_init: function () {
this._base();
},
bind: function (workItem) {
this._base();
},
// Update the control data
invalidate: function (flushing) {
},
// Clear the control data
clear: function () {
}
});
WITCONTROLS.registerWorkItemControl("TFS.WA.ProofOfConcept", ProofOfConcept);
return {
ProofOfConcept: ProofOfConcept
};
});
扩展加载,我可以在模块上设置断点并查看它的构建。我确定我错过了一些非常愚蠢的东西,但我看不到它。
这是 manifest.xml:
<WebAccess version="11.0">
<plugin name="POC" vendor="Acme" moreinfo="http://www.acme.com" version="1.0.0" >
<modules>
<module namespace="TFS.WA.ProofOfConcept" kind="TFS.WorkItem.CustomControl"/>
</modules>
</plugin>
</WebAccess>