Question

When adding a row dynamically using jQuery DataTables plugin, what do I do if one of the cells has to be, say, a checkbox? Just put the HTML in quotes?

Was it helpful?

Solution

Ok now I know it is the plugin that I am using.

I did mine on the server but you should just write the html in the column.

I will try to make an example in a few minutes.

This is how my checkbox comes from the server

"CheckBox":"\u003cinput type=\"checkbox\"\u003e\u003c/input\u003e"

However this should work

dataTable.fnAddData(['<input type="checkbox" name="vehicle" value="Bike" />','SomeOtherDataForAnotherColumn']);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top