Passing input variables server processing

Passing input variables server processing

fernarey18fernarey18 Posts: 11Questions: 6Answers: 0
edited December 2016 in Free community support

`
$(document).ready(function() {
var oTable = $('#fileData').dataTable( {

                                "aLengthMenu": [[10, 25, 50, 100, -1], [10, 25, 50, 100, "All"]],
                                "sPaginationType": "full_numbers",
                                "aaSorting": [[ 0, "asc" ]],                                    
                                "iDisplayLength": 10,
                                "bJQueryUI": true,                                                                                                          
                                "sDom": '<"H"frlT>t<"F"ip>',
                                //<"H"T><"clear">
                                //"sDom": '<"top"i>rt<"bottom"flp><"clear">',
                                "oLanguage": {
                                    "sLengthMenu": "Mostrar _MENU_ clientes",
                                    "sProcessing": "Cargando registros. Por favor espere...", //<img src='ajax-loader.gif'>
                                    "sLoadingRecords": '<img src="ajax-loader.gif">',

                                    "sSearch": "Buscar:",
                                    "sInfo": "Mostrando _START_ a _END_ de _TOTAL_ clientes",
                                    "sZeroRecords": "No hay clientes coincidentes encontrados",
                                    "sInfoFiltered": "(filtrado entre _MAX_ clientes)",
                                    "sInfoEmpty": "Mostrando 0 a 0 de 0 clientes",
                                    "oPaginate" : {
                                        "sFirst" : "Primero",
                                        "sLast" : "Ultimo",
                                        "sNext" : "Siguiente",
                                        "sPrevious" : "Anterior"    
                                    }                        
                                },                  
                                "oTableTools": {
                                    "aButtons": [                                           
                                            //"csv",
                                            /*{
                                                "sExtends": "xls",
                                                "mColumns": [ 1, 2, 3, 4, 5 ],
                                                "sPdfOrientation": "landscape",
                                                "sPdfMessage": ""
                                            },                              
                                            {
                                                "sExtends": "pdf",
                                                "mColumns": [ 1, 2, 3, 4, 5 ],
                                                "sPdfOrientation": "landscape",
                                                "sPdfMessage": ""
                                            },
                                            "print"*/
                                    ]
                                },                                                                      
                                 "processing": true,                                    
                                 "sAjaxSource": "server_processing2.php",
                                 "columns": [   

                                        { "data": 'fecha' } ,
                                        { "data": 'nombre' } ,
                                        { "data": 'item' },
                                        { "data": 'cantidad' },                                         
                                        { "data": 'precio_neto' },
                                        { "data": 'iva' },
                                        { "data": 'precio_total' },
                                        { "data": 'medio_pago' },
                                        { "data": 'datos' },
                                        { "data": 'rubro' }

                                ]
                                // sClass - sWidth 
                            } )




                        } );

`
I want to pass variables from html input fields to server side server_processing.php, and I want to know how to read them in server_processing.php

Answers

  • fernarey18fernarey18 Posts: 11Questions: 6Answers: 0

    Lo solucione asi:
    `
    "ajax": {
    'type': 'POST',
    'url': 'server_processing.php',
    'data': function ( d ) {

                                           d.extra = $("#medio").val();
                                           d.otro = $('select[name=cbo_filtro]').val();
                                           d.fecha_cob = $("#fecha_cob").val(); alert(d.fecha_cob);
                                           d.fecha_cob_h = $("#fecha_cob_h").val(); alert(d.fecha_cob_h);
    
    
                                        }
                                    },
    

    `

This discussion has been closed.