Closed Huuvinh94 closed 2 years ago
It doesn't support disabled button in column config yet, you can customize buttons with cellTemplate
It doesn't support disabled button in column config yet, you can customize buttons with
cellTemplate
Unfortunately it is static. Cannot disable if an external event (for example after got data from server) tell me that should be disabled.
Any other suggestions?
Thanks.
It doesn't support disabled button in column config yet, you can customize buttons with
cellTemplate
Unfortunately it is static. Cannot disable if an external event (for example after got data from server) tell me that should be disabled.
Any other suggestions?
Thanks.
<mtx-grid [data]="list"
[columns]="columns"
[cellTemplate]="{operation: operationTpl}">
</mtx-grid>
<ng-template #operationTpl let-row let-index="index" let-col="colDef">
<button [disabled]="disabled_condition">{{row}}</button>
</ng-template>
Thank you, I'll give it a try.
I use the icon, pop and popTitle feature of the command column, like this:
tableButtons: MtxGridColumn = {
header: 'Operation',
field: 'operation',
width: '160px',
pinned: 'right',
right: '0px',
type: 'button',
buttons: [
{
type: 'icon',
text: 'delete',
icon: 'attach_file',
click: record => this.openFileUploader(record),
},
{
type: 'icon',
text: 'edit',
icon: 'edit',
click: record => this.edit(record),
},
{
type: 'icon',
text: 'delete',
icon: 'delete',
color: 'warn',
pop: true,
popTitle: 'Confirm delete?',
click: record => this.delete(record),
},
],
};
Is there a way to replicate with cellTemplate?
Thanks.
Nevermind. I was able to figure by myself. I had to write my popup confirmation (with MtxDialog.confirm()) and use mat-button-icon for icons. Thank you anyway.
buttons: [ { type: 'icon', icon: 'edit', tooltip: this.translate.stream('organizations.edit'), click: record => this.edit(record), },
edit(value: any) { const dialogRef = this.dialog.originalOpen(LicencesEditComponent, { width: '600px', data: { record: value }, });
dialogRef.afterClosed().subscribe(() => console.log('The dialog was closed'));
}
how can I disable them and open ORGANIZATIONEDITCOMPONENT
@ismailix You mean disable the button? https://ng-matero.github.io/extensions/components/grid/overview#row-with-buttons
@nzbin when I click on this button, it should not open in the dialog window, but instead I want a new window to open
I have column with file
option
and typebutton
, as shown below:How to disabled button?
Please help me? Thanks a lot.