EditableGrid is an open source Javascript library aimed at turning HTML tables into advanced editable components. It focuses on simplicity: only a few lines of code are required to get your first table up and running.
when append() is called on an empty table, it invokes insertAfter() passing rowIndex=(data.length-1)=-1.
This triggers a call to insert() with rowIndex = 0.
At this point however (rowIndex = data.length) which would trigger a call to insertAfter() with rowIndex=-1 again!
Thus we get stuck in an infinite mutual call between insertAfter() and insert().
I have added a check to make sure we only make a second call to insertAfter if data.length > 0.
Fixed adding row to an empty table:
when append() is called on an empty table, it invokes insertAfter() passing rowIndex=(data.length-1)=-1. This triggers a call to insert() with rowIndex = 0.
At this point however (rowIndex = data.length) which would trigger a call to insertAfter() with rowIndex=-1 again!
Thus we get stuck in an infinite mutual call between insertAfter() and insert().
I have added a check to make sure we only make a second call to insertAfter if data.length > 0.