Inline editing for child grid
Inline editing for child grid
Hello,
I would like to do inline editing for my child row. It throws me an error
dataTables.editor.min.js:10 Uncaught TypeError: Cannot read property 'contents' of undefined
at Editor.(anonymous function).(anonymous function) [as inline] (http://localhost:3030/libs/DataTables/Editor-2018-06-26-
1.7.3/js/dataTables.editor.min.js:10:82145)
at dataTables.editor.min.js:10
at dataTables.editor.min.js:10
I have attached the code for your reference.
This question has an accepted answers - jump to answer
Answers
The
inline()
method doesn't accept a row as a parameter, so I'm afraideditor.inline(row);
wouldn't work. Instead what you'd need to do is pass in the element where you want the editing to appear, but you also need to alter the markup a little bit to tell Editor which row is being edited.This is how that might be done:
Note that I've passed in the
row
to the formatting function for the child so I can access the index, and useddata-dt-row
anddata-dt-column
which DataTables uses to figure out which cell in the table that element refers to.Allan
Hello Allan,
Thanks a lot for your help. It woked:)
-Mamta