Reputation: 24
I am using ng2-smart-table. I want to make field editable when it's empty otherwise not.
location: {
title: 'Location',
width: '20px',
filter: false,
valuePrepareFunction: (value) => {
if (value !== '') {
editable : false
} else {
editable: true
}
}
}
Upvotes: 0
Views: 1070
Reputation: 4533
You can use CSS for this in this way.
rowClassFunction: (row) => {
console.log("\nRow is ::: ",row.data);
if (row.data == '')) {
return 'hide_edit';
}
}
To apply this CSS dynamically, Set CSS code in component's .css file...
:host ::ng-deep .hide_edit{
display:none;
}
Upvotes: 1