Quantcast
Viewing all articles
Browse latest Browse all 124

Update MySql with value of CheckBox

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.


Viewing all articles
Browse latest Browse all 124

Trending Articles