答案 0 :(得分:0)
解决。问题是"列"在Aurelia类中定义。但是在ajax回调中,"这个"未定义,解决方案是绑定:
defineRepeater() {
let __this = this;
// initialize the repeater
($('#myRepeater') as any).repeater({
//init stuff
dataSource: __this.customDataSource.bind(__this);
});
}
customDataSource(options: any, callback) {
let __this = this;
...
columns: __this.columns
...
}