I am learning as I go on this one and I'm not sure of the capabilities but here are the bullets of what I'd like to do with it. Currently I have fist bullet "kinda" working with the below code. Not ideal but it's the only thing i could figure out.
Data Table purpose: Drivers fill in all of their violations for an annual review. They add a new row per violations filling in Date, Violation Type (Drop down with "Other" option), and location of violation.
- If driver selects "Other" make the next column Editable otherwise it's read only.
- Make the column "Other" required if Violation Type "Other" is selected.
- Return a record count in the Before Save to ensure they added all they expected to.
fd.control('ViolationTable').addColumnValidator('Violation', {
validate: function(value) {
if (value == 'Other') {
fd.control('ViolationTable').columns[2].editable = function(){return true};
return true;
}
fd.control('ViolationTable').columns[2].editable = function(){return false};
return true;
}
});