How to pass a row id into a edit button to use inside bootstrap modal using serverside processing

How to pass a row id into a edit button to use inside bootstrap modal using serverside processing

jeansefanjeansefan Posts: 3Questions: 2Answers: 0
edited April 2019 in Free community support

I need pass the row id to a bootstrap modal using the serverSIde processing.
Here is my actual code:

 <script type="text/javascript">
    $(document).ready(function(){
        $("#tbl_produto").DataTable({
            "ajax":{
                "url":"../app_prestador/controllers/getProdutosJson.php",
                "dataSrc" :""
            },
            "columnDefs": [ {
            "targets": -1,
            "data": null,
            "defaultContent": "<button  data-toggle='modal' data-target='#modalEditaProduto' class='btn btn-icon btn-warning btn-sm'>Editar</button>"
        } ],
            "columns":[
                {"data":"codigo"},
                {"data":"nome"},
                {"data":"tipo"},
                {"data":"modeloNome"},
                {"data":"fabricanteNome"},
                {"data":"nomesit"},
                {"data":"criado"},
                {"data":"modificado"},
                {"data": null}
            ],
        });
    });
</script>

Answers

  • colincolin Posts: 15,240Questions: 1Answers: 2,599

    Hi @jeansefan ,

    Which row do you want? One that's clicked on, or some other? We're happy to take a look, but as per the forum rules, please link to a test case - a test case that replicates the issue will ensure you'll get a quick and accurate response. Information on how to create a test case (if you aren't able to link to the page you are working on) is available here.

    Cheers,

    Colin

This discussion has been closed.