Open leticiafatimaa opened 6 years ago
Hi! I got same issue... How we fix?
same issue how to fix it
Try to set false the add, edit & delete properties on actions.
Here an example: (The image result below, with actions & template custom)
columns: {
ImageURL: {
title: 'image',
type: 'html'
},
name: {
title: 'Environment'
},
select: {
title: '',
type: 'custom',
renderComponent: SelectEnvironmentComponent,
onComponentInitFunction(instance) {
instance.select.subscribe(
environment => instance.selectEnvironment(environment)
);
}
}
},
mode: 'external', // Use external functions to Edit/Delete, etc.
hideSubHeader: true, // Don't show the Add row
actions: {
add: false,
edit: false,
delete: false,
custom: [
{
name: 'edit',
title: '<i class="material-icons inline-block">edit</i>'
},
{
name: 'delete',
title: '<i class="material-icons text-danger">delete</i>'
},
{
name: 'Button',
title: 'Test!'
}
]
}
Got a fix in my global scss file
tr .ng2-smart-actions{ display: flex; }
ng2-st-tbody-custom {display: flex;}
ng2-st-tbody-edit-delete a.ng2-smart-action {display: inline-block !important;}
ng2-st-tbody-create-cancel a.ng2-smart-action {display: inline-block !important;}
ng2-st-tbody-custom a.ng2-smart-action.ng2-smart-action-custom-custom {
display: inline-block;
width: 70px;
text-align: center;
}
In the screenshot, all icons are custom action adn all text button are the native edt/delete you can play with the withd and text-align
Got a fix in my global scss file
tr .ng2-smart-actions{ display: flex; } ng2-st-tbody-custom {display: flex;} ng2-st-tbody-edit-delete a.ng2-smart-action {display: inline-block !important;} ng2-st-tbody-create-cancel a.ng2-smart-action {display: inline-block !important;} ng2-st-tbody-custom a.ng2-smart-action.ng2-smart-action-custom-custom { display: inline-block; width: 70px; text-align: center; }
In the screenshot, all icons are custom action adn all text button are the native edt/delete you can play with the withd and text-align
This fix worked for me. Thanks @NicolasKritter
I'm trying to add a button to custom action, but a new column is not added in the action, making the button overlap with the others.