I need buil one system for insert into database

I need buil one system for insert into database

josimarsbjosimarsb Posts: 12Questions: 0Answers: 0
edited September 2013 in DataTables 1.9
I need buil one system for insert into database and I am using datatables.
It is master/detail system.
I want send data from my datatable for my server in php.
I don't speak english very well but I need yours help.

Thank you.

Replies

  • jhcomputejhcompute Posts: 26Questions: 0Answers: 0
    Hello,

    I am not sure if the Editor is what you are needing. It is a CRUD framework for datatables.

    http://editor.datatables.net/

    Below is a link that might be what you are looking for.

    http://editor.datatables.net/release/DataTables/extras/Editor/examples/deepObjects.html

    Cheers...
  • josimarsbjosimarsb Posts: 12Questions: 0Answers: 0
    Thank you, but I need send the table values to server and save in the database.
    do you have one exemple about this?

    var oTable;
    $(document).ready(function() {
    $('#example').dataTable({
    "oLanguage": {
    "sLengthMenu": "Mostrar _MENU_ Itens por página",
    "sZeroRecords": "Nenhum resultado econtrado",
    "sInfo": "Itens _START_ até _END_ de _TOTAL_ registros",
    "sInfoEmpty": "Tabela vazia",
    "sInfoFiltered": "(encontrado(s) de _MAX_ registros)",
    "sLoadingRecords": "Aguarde...",
    "sSearch": "Procurar:",
    "oPaginate": { "sFirst": "Início", "sPrevious": "Anterior", "sNext": "Próximo", "sLast": "Último" }
    },
    "bServerSide": true,
    "sAjaxSource": "../ajax/ccusto.php",
    "fnServerData": function ( sSource, aoData, fnCallback ) {

    aoData.push( { "produto": "josimar", "value": "1"} );

    $.ajax( {
    "dataType": 'json',
    "type": "POST",
    "url": sSource,
    "data": aoData,
    "success": fnCallback
    } );
    },
    "sPaginationType": "full_numbers",
    "sScrollY": 200,
    "bLengthChange": false,
    "bInfo": false,
    "bFilter": false,
    "asStripeClasses": [ 'linha_impar', 'linha_par' ],
    "aoColumns": [
    { "sTitle": "Produto", "mDataProp": "produto"},
    { "sTitle": "Qtde", "mDataProp": "qtde" }
    ]
    });
    oTable = $('#example').dataTable();
    });

    function fnClickAddRow() {
    /*oTable.fnAddData(
    ['',$('#qtde').val() ]
    );*/

    oTable.fnAddData(
    [$('#descr_prod').val(),$('#qtde').val() ]
    );

    }
  • allanallan Posts: 63,498Questions: 1Answers: 10,471 Site admin
    So you want users to be able to edit table values? Sounds like Editor is what you want as jhcompute says.

    Allan
This discussion has been closed.