Getting undefined (reading 'attach') with multiple tables
Getting undefined (reading 'attach') with multiple tables
In my application I am trying to use multiple tables with multiple editors with in-line editing. When I go to click the edit button I get the console error "Cannot read properties of undefined (reading 'attach')". I get this error on all of my tables except the final table I have. I have designated different editors to the different tables, but the code only seems to be able to pick up the last table initialized. Attached is a sample of some of my code, unfortunately I do not have a link to my code. Any help/suggestion to have the Edit buttons picked up for each individual table would be helpful.
This question has an accepted answers - jump to answer
Answers
Looks like you are using the var
table
for each Datatable. You should use different variables for this like you have for the different Editors.That is why this click event:
and this click event:
Only work on the last Datatable assigned to the variable
table
.Kevin
That works. thank you! I didn't realize that even though I designate the id of the table to the click handler, that it's still picking up the variable table. I thought the "table" in the that statement was solely because it was a table.