Hi,
I want to do validation with custom message like :
If (TrackedBy = PERCENTAGE), then it should so me message like,
percentage should not be greater than 100
2nd if If (TrackedBy = BINARY ),
then i have to show dropdown field with option and we will have to select one field from there.
.Below is the code i followed, but not sure how can i show custom message and show dropdown based on condition.
Example:
{
text: 'Cumulative Actual Progress',
field: 'progress',
cls: 'progress-header',
cellCls: 'progress-cell',
editor: true,
region: 'middle',
finalizeCellEdit: context => {
console.log('context', context);
const { value = '', record = '' } = { ...context };
const { progress = '', trackedBy = '', quantity = ''} = { ...record };
// if there is no progress, actual st date can not be edited
if (trackedBy === 'PERCENTAGE' && progress ==100) {
return false;
}
if (trackedBy === 'QUANTITY' && quantity == 100) {
return false;
}
if (trackedBy === 'BINARY' && quantity == 100) {
return false;
}
return true;
},
invalidAction: 'revert',
renderer({ cellElement, row, record, value }) {
if (record.isEdited['progress'] === true) {
cellElement.classList.add('editedData');
}
return `${String(value)} ${record?.progressUnit}`;
}
},