Dynamically Adding a CheckBox in a Row

Dynamically Adding a CheckBox in a Row

wurb_travelskywurb_travelsky Posts: 3Questions: 0Answers: 0
edited March 2010 in General
Hi, I am a newbie in JQuery, and also in DataTables.
My question is if I want to 'dynamically' add rows to an empty table, how could I add form elements(such as checkbox, radio, and so on)?
Fairly appreciate if anyone could help me.

Replies

  • pktmpktm Posts: 27Questions: 0Answers: 0
    Hi!

    Cf http://datatables.net/examples/api/add_row.html for how to add a row via JavaScript.
    You can specify the html for a checkbox there.

    If you want to add the checkbox while rendering the table, you can do this via fnRender(), there is an example here: http://datatables.net/examples/advanced_init/column_render.html

    Ask more if you encounter any problems while trying :-)

    hth, pktm
  • wurb_travelskywurb_travelsky Posts: 3Questions: 0Answers: 0
    it works, nice!
    Thanks, pktm.
This discussion has been closed.