Editor - Uncaught TypeError: Cannot read property 'contents' of undefined
Editor - Uncaught TypeError: Cannot read property 'contents' of undefined
i use inline editing. When i edit a cell and then click outside of table, there is not problem. But if i click another cell after edit, it give 'Uncaught TypeError: Cannot read property 'contents' of undefined' error. In the video you can see what I mean.
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
Are you using Editor 1.5.3 (the current latest release)? Also, could you give me a link to the page so I can debug it please.
Thanks,
Allan
Yes i use editor 1.5.3.
i send the link via private message
Super - thanks for the link! The issue is the combination of inline editing and server-side processing - they can be used together, but we just need to be a little careful with how we call the
inline()
method. At the moment you have:The issue there is that after the submit the table will be redrawn and the cell that was clicked on (
this
) no longer exists - hence the error.The way to fix is fairly easy, we just give Editor the cell index rather than the cell node:
The index is still value after the redraw so this will work.
You also need to change
$('#example').DataTable(
to be:Regards,
Allan
Thank you so so much. You are a hero.