You need to sign in to do that
Don't have an account?
VVH
on row action disable
actions = [
{label: 'Preview', name: 'Preview', disabled: true},
{label: 'Remove', name: 'Remove', disabled: false}
];
@track columns = [
{
type: 'action',
typeAttributes: { rowActions: this.actions },
},
];
handleRowAction(event) {
switch (actionName) {
case 'Remove':
if(this.selectedRows.length>1){
//make disabled true
}
else{
//do something else
}
break;
default:
}
}
How to make disabled true in if condition? this.actions[1].disabled = true didnt work. Any other idea?
thanks in adavance
{label: 'Preview', name: 'Preview', disabled: true},
{label: 'Remove', name: 'Remove', disabled: false}
];
@track columns = [
{
type: 'action',
typeAttributes: { rowActions: this.actions },
},
];
handleRowAction(event) {
switch (actionName) {
case 'Remove':
if(this.selectedRows.length>1){
//make disabled true
}
else{
//do something else
}
break;
default:
}
}
How to make disabled true in if condition? this.actions[1].disabled = true didnt work. Any other idea?
thanks in adavance
Please check out this similar thread and discussion, which could help you implement this:
https://salesforce.stackexchange.com/questions/212676/lightningdatatable-dynamically-disable-rowactions
Hope above information helps, Please mark as Best Answer so that it can help others in the future.
Thanks.