I know why it is so slow now.
When you add after setCell in afterInsertRow for 250 rows, It actually attached click function 250 times for the first row (We can do math for other row).
The correct place is in “gridComplete: function() { }”
Thanks again, your suggestion still led to solve my problem.