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

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

optimusptimedoptimusptimed Posts: 2Questions: 1Answers: 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.

Answers

  • optimusptimedoptimusptimed Posts: 2Questions: 1Answers: 0

    Does anyone have an example of a <button> calling a function and passing parameters inside a data source for an Ajax data-table?

This discussion has been closed.