Update MySql with value of CheckBox
Update MySql with value of CheckBox
finando
Posts: 3Questions: 1Answers: 0
Hello to all.
I'm new with this, so excuse me if the question is too simple.
I have the following situation.
$(document).ready(function() {
var oTable = $('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sPaginationType": "full_numbers",
"oLanguage": {
"sSearch": "Localizar:",
"sLoadingRecords": "Aguarde - carregando..."
},
"sAjaxSource": "Carga_infos.php",
"aoColumns": [
{"sClass": "readonly"},//ID
{"sClass": "readonly"},//Name
{"sClass": "readonly"},//Job
{"sClass": "readonly"},//Email
{"sClass": "readonly"},//UserId
{"sClass": "readonly"},//CC
{"sClass": "readonly"},//Area
{},//Doc
{},//Fone
{},
{"fnRender": function (oObj) {
return "<input type='checkbox' name='check'>";
},
"sClass": "readonly",
"bSearchable": false,
"bSortable": false
}//checkbox
],
"fnDrawCallback": function () {
$('#example tbody td').not(".readonly").editable( 'UpdateData.php', {
"callback": function( sValue, y ) {
oTable.fnDraw();
},
"submitdata": function ( value, settings ) {
var rowData = oTable.fnGetData( $(this).parents('tr')[0] );
return {
"rowId":rowData[0],
"row": oTable.fnGetPosition( this )[0],
"column": oTable.fnGetPosition( this )[1]
};
},
"height": "14px"
} );
}
} );
} );
My question is.
How do I get the CheckBox is checked or not to update the database?
"submitdata": function ( value, settings ) {
var rowData = oTable.fnGetData( $(this).parents('tr')[0] );
return {
"rowId":rowData[0],
"row": oTable.fnGetPosition( this )[0],
"column": oTable.fnGetPosition( this )[1],
"checkbox":__________????
};
Thanks.
This discussion has been closed.
Answers
Any tips?
I have not found a solution to let the editable checkbox and update the database.
If I remove the ReadyOnly class appears the HTML code.
There's no way to get the value of checkbox on editable field.
So I did different.
Works fine.