Quantcast
Channel: Recent Discussions — DataTables forums
Viewing all articles
Browse latest Browse all 82462

Putting a button with a javascript function and parameters in an Ajax datatable

$
0
0

Hi,

This ajax data structure that includes a <button> to call a function and pass some parameters does not seem to work:

{ "data": [ [ "<button class='btn' onclick='myfunction(\"1\", \"test\");'>", "test, test" ] ] }

Can this be done? The table does not render. Remove the button, and it does.

Also, if I wanted to call my function for a particular row, how can swap in the values for the actual fields so that they are correctly passed? I tried looking at the API guide but there is only an example that shows a single item for an entire row. I need multiple buttons to pass data. Any pointers appreciated.


Viewing all articles
Browse latest Browse all 82462

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>