Adding row then delete that same row: Maximum call stack size exceeded
Adding row then delete that same row: Maximum call stack size exceeded
So everything works perfectly, except when using the editor if I insert a new row then select and delete that row I always get Uncaught RangeError: Maximum call stack size exceeded (and lots of: n.extend.n.fn.extend recursive calls).
If I refresh the page after inserting there is no problem, I can delete/edit/etc. at will. Just if I insert a new row and then without refreshing proceed to try and delete it, that popup "Are you sure?" freezes with the errors popping up in the console.
The back-end of this inserts a new row into the database with an auto-incrementing ID. I'm wondering if this has something to do with the issue (inserting a new row with a blank ID). I see when the new row is inserted the ID shows up accurately in it's column, but when I look at the "onsubmit" of the new row insertion, the json data ID is null.
Any help anyone can provide on this is much appreciated!
The code is for a client so I can't show it here, however I could modify it if necessary and post.
Answers
If you could modify it and then link to the page showing the issue, that would let me trace through it and help to debug. I've not encountered that issue before.
What is the server-side responding with when you create a new row? Can you show me that JSON? Does it include the newly created ID (it should be blank, presumably the database will set it on
INSERT
).Allan
Hi Allan, I'm currently running it on localhost through an ngrok tunnel so I'd prefer to not share, but can PM a temp link if needed.
Hopefully this will help clarify though.
When inserting a new row the data is inserted into the database with a null ID which autoincrements in the DB. After insertion, another query calls the last inserted row and gets the ID which is added to the json that's returned, here's the raw dict that's returned (before being converted to json):
That is just directly converted to json, so "onsubmit" had to add the proper "data" wrapper, and that code looks like so:
That console.log you see above spits out this data:
So after hitting "Create" on the Editor popup the row is inserted into the table and all data in that new table row is accurate to what had been entered in the Editor popup (including the ID), if I refresh the page everything works perfectly with no problems. It's only if I happen to delete that freshly created row without refreshing first that the problem occurs.
That does look like it should work okay. If you could PM me the link, that would be awesome. You can send me a PM by clicking my forum user name above and then "Send message".
Allan