Recover server-side values

Asked

Viewed 142 times

0

I have a datatables that lists the values as follows:

<table id="datatable_fixed_column" class="table table-striped table-bordered" width="100%">
  <thead>
    <tr>                                            
      <th>Protocolo</th>
      <th>Assunto</th>
    </tr>
  </thead>                                    
</table>

Javascript

$(document).ready(function() {

    var otable = $('#datatable_fixed_column').DataTable({

    "processing": true,
    "serverSide": true,
    "ajax": "server_processing/protocolos.php",

    "order": [[ 0, "asc" ]],

    "columnDefs": [
    { "width": "20%", "targets": 0 },
    { "width": "80%", "targets": 1 },
    ],
"sDom": "<'dt-toolbar'<'col-xs-6'f><'col-xs-6'<'toolbar'>>r>"+
            "t"+
            "<'dt-toolbar-footer'<'col-xs-6'i><'col-xs-6'p>>"
    });

     $("div.toolbar").html('<div class="text-right"><img src="img/logo2.png" alt="SmartAdmin" style="width: 111px; margin-top: 3px; margin-right: 10px;"></div>');

})

I would like to include in this table another column with a button to edit, like this:

<form method="post" action="">
  <input type="hidden" id="idcontrib" name="idcontrib" value="<?=$protocolo?>">
    <button type="submit" class="btn btn-warning btn-xs" name="edit_contrib">
      Editar
    </button>
</form>

Note that the variable $protocolo store the protocol value on that line.

How do I assign the protocol value to a variable?

I’m trying to reproduce something like:

<table id="datatable_fixed_column" class="table table-striped table-bordered" width="100%">
  <thead>
    <tr>                                            
      <th>Protocolo</th>
      <th>Assunto</th>
      <th>Ação</th>
    </tr>
  </thead>                                    
</table>

2134    Teste    [Editar] ($protocolo = 2134)
9999    teste 2  [Editar] ($protocolo = 9999)
  • Guys, I still can’t, someone can help me ?

  • Guys, come on, can someone help me ? Is that impossible ??

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.