【发布时间】:2017-08-30 02:38:09
【问题描述】:
我正在使用 Devextreme 产品的dxDataGrid UI 小部件。
我想让它的一列用作按钮。因此,到目前为止,我已经完成了以下清单:
我的一个领域
{ dataField: 'LetterNumber', caption: 'Letter Number', cellTemplate: showLetterImageTemplate }
它的 CellTemplate 显示按钮
function showLetterImageTemplate (cellElement, cellInfo) {
cellElement.html(' <button class="btn btn-info btn-sm btn-block" ng-click="show('+cellInfo+')">' + cellInfo.displayValue + ' </button> ');
$compile(cellElement)($scope);
};
点击字段中的按钮调用的函数
$scope.show = function (cellInfo) {
DevExpress.ui.notify("TEST" + cellInfo.data, "error", 2000);
}
问题是我想将当前点击的行数据传递给Show() 函数,这样我就可以了解点击了哪一行。但是,当我单击该按钮时,出现以下错误:
ng-click=Show([对象对象])
请注意,我使用 Agular 作为我的 UI 框架。
【问题讨论】:
标签: javascript angularjs devexpress devextreme