【发布时间】:2020-06-08 09:33:55
【问题描述】:
我有下面的 DataGrid 列 cellTemplate 编码为:
ctAccount(cellElement, cellInfo) {
$('<div>')
.appendTo(cellElement)
.text(cellInfo.data.Other)
.css('cursor', 'pointer')
.on('click', function(event) {
this.dDetail["aaa"] = { store: AspNetData.createStore({
key: "ID",
loadParams: { id: cellInfo.data.GroupID },
loadUrl: this.Svr.urlSuspect + "Group"
})
};
...
...
问题是编译器无法访问“this”(this.dDetail,this.Svr),因为“this”指的是“this: HTMLElement”,而不是指我的 Angular 项目。错误信息是
类型“HTMLElement”上不存在属性“xxx”。
如何在 this.dDetail 和 this.Svr 上编码?
【问题讨论】:
标签: jquery angular devextreme