I'm using a Grid configured with colums [commands] like this:
While using my app, when a condition occurs, I would like to change the command icon of 'Save' to:
How can I do?
Thanks
Is simple, when I click on button, the cusom class icon of update button must be changed:
https://stackblitz.com/edit/angular-gpxelt?file=app.component.html
|
[app.component.ts]
onClick() {
// change the command properties through the Grid instances
this.grid.getColumnByIndex(5).commands = [
{
type: 'Edit',
buttonOption: { iconCss: ' e-icons e-edit', cssClass: 'e-flat' },
},
{
type: 'Delete',
buttonOption: { iconCss: 'e-icons e-delete', cssClass: 'e-flat' },
},
{
type: 'Save',
buttonOption: {
iconCss: 'e-icons e-update',
cssClass: 'e-flat e-change-scale-ratio', // add the custom class as you want
},
},
{
type: 'Cancel',
buttonOption: { iconCss: 'e-icons e-cancel-icon', cssClass: 'e-flat' },
},
];
this.grid.freezeRefresh(); // refresh the Grid
}
[app.component.css]
.e-grid .e-change-scale-ratio .e-update::before {
content: '\e295'; // bind the custom icon as you want
}
|