in my sceario, i am using beforechange hook, in that my first column is date , second column is a dropdown, if i am selecting dropdown column with out selecting date column , i want show an error, please enter date first and i dontwant to set selected value to that cell, but this setDataatcell is continuosly calling. how to restrict this. please explain
Beforechange hook how to retrict to dint set the value to cell
If you are experiencing the infinite loop via setDataAtCell()
within beforeChange
hook it means that you did not set the IF
condition for the 4th
setDataAtCell()
parameter.
As mentioned in the documentation at https://handsontable.com/docs/javascript-data-grid/api/core/#setdataatcell the 4th parameter is a string and if you pass it as
hot.setDataAtCell(0, 0, 'test
, ‘mySetData’)`
then you can create such a IF
statement to block the loop
if(source !== 'mySetData'){ hot.setDataAtCell(0, 0, 'test
, ‘mySetData’) }`