I want to use a template for my command button. like this:
command: [ { name: "editReport", template: "<button type='button' class='btn btn-link' title='Redigér rapport' data-ng-click='vm.onEdit()' data-ng-disabled='!vm.canEdit'><i class='fa fa-pencil' aria-hidden='true'></i></button>" } as any, { name: "deleteReport", template: "<button type='button' class='btn btn-link' title='Slet rapport' data-ng-click='vm.onDelete()' data-ng-disabled='!vm.canDelete'><i class='fa fa-minus' style='color:darkred' aria-hidden='true'></i></button>" } as any,],title: "Handlinger", width: 50We are in a Angular controller and I want to get the JQueryEventObject in the vm.onDelete() function.
If that not possible then maybe I could get the Id of the row in the binding vm.onDelete({{dataItem.Id}}).
Or is there another way to make a image button?
public onDelete = (e: JQueryEventObject) => { this.$confirm({ text: 'Ønsker du at slette rapporten?', title: 'Slet rapport', ok: 'Ja', cancel: 'Nej' }) .then(() => { var dataItem = this.mainGrid.dataItem(this.$(e.currentTarget).closest("tr")); var entityId = dataItem["Id"]; this.mainGrid.dataSource.remove(dataItem); this.mainGrid.dataSource.sync(); }); }