1
I would like to place a column at the end, with a checkbox or toggle switch button for all rows coming from an ajax call.
I managed to put by sDefaultContext and mRender, but the checkbox does not work, does not recognize the click.
Does anyone know how to solve?
Currently, I use the following code snippet:
"aoColumnDefs" : [
//adiciona a classe para todas as células referente a coluna indicada
{"sClass" : "hidden-xs sorting","aTargets" : [1]},
{"mData": null, "sDefaultContent": "<input type='checkbox' name=''></input>","aTargets": [3]}
]
How are you adding the checkbox? you can put so when adding the checkbox { onclick='Method()'; }
– PauloHDSousa
@Paulohdsousa I currently use this code snippet : oTable = $('#table1'). datatable({ "aoColumnDefs" : [ //add the class for all cells referring to the specified column {"sClass" "Hidden-Xs Sorting","aTargets" [1]}, {"mData": null, "sDefaultContent": "<input type='checkbox' name=''></input>","aTargets": [3]} ], It appears as I want it just doesn’t work properly
– Ysabelle Sousa
So do -> oTable = $('#table1'). datatable({ "aoColumnDefs" : [ {"sClass" : "Hidden-Xs Sorting","aTargets" [1]}, {"mData": null, "sDefaultContent": "<input onclick="Alert('Call a method here');" type='checkbox' name='></input>","aTargets": [3]} ], Just put the method out and create... does not try to bind elements dynamically added
– PauloHDSousa