closest function, not working
closest function, not working
Coder102
Posts: 78Questions: 2Answers: 0
http://live.datatables.net/tivipaxe/1/edit
Hello, my idea is that when I click on "btnChart" it will show me in the console the data of the row that you clicked
i would like to show clo1, col2 and col3
BTN CHART IS IN THE ACTION COLUMN
This discussion has been closed.
Replies
THere's a few things wrong there - but this should get you going - http://live.datatables.net/cedurofe/1/edit
The important bit is
Colin
document.getElementsByClassName("btnChart").onClick=function(e){
The problem is the event isn't firing. Not sure this method will work. If you want to use DOM elements to create you events this SO thread may help. However I'm not sure if they will work with Datatables when changing pages. See this FAQ for more info.
You can use jQuery delegated events as shown in this example. I updated your test case to show this:
http://live.datatables.net/datuyafi/1/edit
Also note that you need to use
cell().render()
to get the rendered data. I show how in the example.Kevin
I appreciate the help always. Thank you so much guys