mercredi 25 février 2015

Datatables add select options dropdown and checkbox with row.add

I see examples fitting my need for dropdown selects and checkboxes such as this one here however they all assume we have the html to fiddle with.


In my case instead I have an empty table I populate with the following JQuery:



for (i = 0; i < contactDataLength; i++)
{
currentRow = contactTable.row.add([
contactDataArr[i].CONTACT_VAL1,
contactDataArr[i].CONTACT_VAL2,
contactDataArr[i].CONTACT_NOTES,
'<input type="checkbox" name="delete" value="">'
]).draw();
}


in this example I add a column as a checkbox input, however this is the wrong way to do it.


How do I add checkboxes and selects programatically??





Aucun commentaire:

Enregistrer un commentaire