5

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?

5
  • Are you talking about datatables.net? Commented Aug 9, 2010 at 21:26
  • @chobo, no, not .net. The jquery plugin called DataTables. @Sar I haven't tried anything yet. Feel free to ignore me while I try that. Commented Aug 9, 2010 at 21:27
  • Can you put a link. There seems to be many things called DataTables. Commented Aug 9, 2010 at 21:29
  • @cho -- I see, I competely misread your comment. Yes, it's the thing from datatables.net. However, I've hit a much dumber problem in before I can even try this issue here. Commented Aug 10, 2010 at 0:08
  • @cho It was a stupid error not worth discussing here. All is well. Commented Aug 10, 2010 at 13:00

1 Answer 1

10

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']);
Sign up to request clarification or add additional context in comments.

1 Comment

Deprecated Custom display function that will be called for the display of each cell in this column. check here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.