Hi,
I’m currently using setCellMeta() to change the valid field of Cell Meta in afterChange.
Every thing work fine as long as I use afterChange and setCellMeta for two different cell. But when I change value of a cell (for example: cell [1, 1]), then I setCellMeta invalid for the same cell (cell [1, 1]) => it’s not work. Do you have any suggestion?
Thank u so much for anyhelp.
Set cell inValid in afterChange
Update: seem like it’s still work but only after another call to afterchange function. Not immediately. Still don’t know how to fix this
Hi @gumanh94
Can you help me to replicate the same issue? I’ve made a basic example here https://jsfiddle.net/AMBudnik/m39hnjg8/ and just need the setCellMeta
in the right place.
I tried but at ur example, the setCellMeta doesn’t work at all.
Do you mean that the setCellMeta
does not attach the cell meta or it does not generate the error if you place it in the JSFiddle?
I tried to setCellMeta valid = false in afterChange when the new value = 3 => but the cell does not turn RED (htInvalid)
I guess that it might be better to use the beforeValidate
hook. We usually do not recommend changing the cell validity within the cell meta.
Can you describe the use case? I picture that you have a table with some predefined data loaded from the server. Then at some point, you get a server response that this data is no longer valid. I am right?
I loaded data from server and allow user to change the cell value, but the changed value can not be larger than another specific cell. So I tried to validate the new value in the afterChange func.
As you suggest, I tried the afterValidate func => it’s work perfectly.
Thank u so much for ur help.
Thank you for the update. I am glad that you’ve found the best API for this task.