Can anyone help? (Show data for selected row and error in console output)
Can anyone help? (Show data for selected row and error in console output)
asbjotve
Posts: 3Questions: 2Answers: 0
This is my table: https://live.datatables.net/vezukubi/1/
I have tried to get a dialog (alert) that will output the line_id for selected row. But I can't get it to work.
Also, the console output shows ""[object Object] (line 3)" - what does that means?
This question has an accepted answers - jump to answer
Answers
Your test case has a couple errors. First this:
Its due to having duplicate code in the HTML tab and the Javascript tab. Removing the duplicate code results in this error when clicking a row:
Your assignment is wrong. The issue you are asking about is with
.data()[0]
. You definedcolumns.data
which means the rows are using object based data but.data()[0]
is using array notation. Use.data().line_id
. Here is the updated example with all the fixes:https://live.datatables.net/vezukubi/1/edit
Kevin