У меня есть функция для обновления нескольких строк таблицы при нажатии кнопки. Он должен добавить класс selected
в строки.
<button class=\"btn btn-flat\" onclick=\"if(confirm('Deseja realmente excluir o registro?')) window.location.href='".base_url("adm/pedidos/excluir/".$registro->id)."';\">
<span class=\"awe-remove\"></span>
</button>";
<table class="datatable table table-bordered" id="example">
<thead>
<tr>
<th class="t-center">Pedido</th>
<th class="t-center">Data</th>
<th>Cliente</th>
<th class="t-center">Frete</th>
<th class="t-center">Valor Total</th>
<th class="t-center">Status</th>
<th class="t-center">Pagamento</th>
<th class="t-center">Ação</th>
</tr>
</thead>
<tbody>
<?php
foreach($registros as $registro)
{
echo "<tr class=\"".situacaoClasse($registro->situacao)."\">";
echo '<td class="t-center">'.$registro->id.'</td>';
echo "<td><span style='display:none;'>".$registro->data."</span>".converteDataHora($registro->data)."</td>";
echo '<td class="pedidonome">'.strtolower($registro->nome ? $registro->nome : $registro->razao_social).' ('.$registro->uf.')</td>';
echo '<td class="t-center">R$ '.ConverteReal($registro->frete).' ('.getTipoFrete($registro->tipo_frete).') <br> '.($registro->frete_prazo ? '<small>'.$registro->frete_prazo.' dia(s) - '.ConverteData($registro->frete_prazo_data).'</small>' : '').'</td>';
echo '<td class="t-center">R$ '.ConverteReal($registro->valor_pedido).'</td>';
echo '<td class="t-center">'.$registro->situacao.'</td>';
echo '<td class="t-center">'.getPagamento($registro->pagamento).'</td>';
echo "<td class=\"toolbar\">
<div class=\"btn-group\">
<a class=\"btn btn-flat\" href=\"".base_url("adm/pedidos/alterar/".$registro->id)."\">
<span class=\"awe-wrench\"></span>
</a>
";
if ($this->session->userdata('usuario_tipo') == 'adm')
{
echo "
<button class=\"btn btn-flat\" onclick=\"if(confirm('Deseja realmente excluir o registro?')) window.location.href='".base_url("adm/pedidos/excluir/".$registro->id)."';\">
<span class=\"awe-remove\"></span>
</button>";
}
echo "
</div>
</td>";
echo "</tr>";
}
?>
</tbody>
</table>
Но когда я нажимаю кнопку, ничего не обновляется.