Inline Delete button in detailsgrid not working #7356
Unanswered
rhemasystems
asked this question in
Help
Replies: 1 comment 1 reply
-
try this: protected getColumns() {
var columns = super.getColumns();
if (this.enableDeleteColumn()) {
columns.splice(0, 0, {
field: 'Delete',
name: '',
format: ctx => hasPermission(this.getRowDefinition().insertPermission) || hasPermission(this.getRowDefinition().updatePermission) ? <a class="inline-action" data-action="delete" title="Delete Record"><i class="fa fa-trash text-red"></i></a> : ``,
width: 24,
minWidth: 24,
maxWidth: 24
});
}
return columns;
}
protected onClick(e: Event, row: number, cell: number) {
super.onClick(e, row, cell);
if (Fluent.isDefaultPrevented(e))
return;
var item = this.itemAt(row);
var action = (e.target as HTMLElement).closest(".inline-action")?.getAttribute("data-action");
if (action == "delete") {
e.preventDefault();
confirmDialog(localText("Controls.EntityDialog.DeleteConfirmation"), () => {
this.deleteEntity(item[this.getIdProperty()]);
});
}
} |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Please I am using the below to enable the inline delete feature in detailseditor.tsx, I want to delete a row after adding.
How do I achieve it in detailsgrid.tsx
protected enableDeleteColumn(): boolean {
return true;
}
Beta Was this translation helpful? Give feedback.
All reactions