0
我正在使用Angular UI-Grid v3.0.4。我正在使用columndef单元格模板来获取所需的定制,如下所示(我在模板中有ng-blur事件和方法)。角度Ui网格模糊事件不会触发
$scope.gridOptions = {
showColumnFooter: true,
columnDefs: [
{
name: "SalesAmount", displayName: "Sales Amount"
},
{
name: "CommissionAmount", displayName: "Commission Amount", enableCellEdit: true, enableCellEditOnFocus: true,
cellTemplate: '<input type="text" ng-model="row.entity.pddCommissionAmount" ng-blur="updateEntitys(row.entity)"></input>'
}
]
};
ng-blur事件不会触发其执行。研究并添加一个自定义ngblur指令,看看是否有帮助
app.directive('ngBlur', function() {
return function (scope, elem, attrs) {
elem.bind('blur', function() {
scope.$apply(attrs.ngBlur);
});
};
});
$scope.updateEntitys = function (row) {
alert("Update Entitys within ngblur event");
}
这似乎不工作。非常感谢任何帮助。