代码:
H.Binder.TaskColor = function ($elem, role, value, data) {
this.element = $elem;
this.value = value;
this.data = data.Activity;
this.init = function () {
var ProgressPercent = this.data.ProgressPercent;
if (ProgressPercent < 50)
this.element.addClass("style1");
else
this.element.addClass("style2");
}
this.refresh = function () {
this.init();
}
}
HTML:
TaskItemTemplate="<div class='rq-gc-taskbar' data-bind='TaskColor: Activity.ProgressPercent' ><div class='rq-gc-taskbar-label'></div></div>"
错误:
0x800a139e - JavaScript运行时错误:无法解析绑定。
消息:ReferenceError:&#39;活动&#39;未定义;
绑定值:TaskColor:Activity.ProgressPercent