问题描述:

I am using DataTable to get json data from a file in php to a table, I tried to update a row with fnUpdate but it seem not work in this way (pull data in json format), I would like know from you how update it only in a row, (not exist tags td in my table, only exist tbody in order to datatable add the data with tr and td inside it.

code:

<script>

function tabelaProdutos(){

var table = $('#tabela_produto');

var tabela = table.dataTable({

"ajax": "tabelas/produtos_para_locar.php",

"columns": [

{ "data": "option"},

{ "data": "id2" },

{ "data": "nome2"},

{ "data": "categoria"},

{ "data": "subcategoria"},

{ "data": "disponivel"},

{ "data": "locado"},

{ "data": "total"},

{ "data": "info"}

]/*,

"pageLength": 7,

"lengthMenu": [[7, 25, 50, 100, -1], [7, 25, 50, 100, "Todas"]],

"aoColumnDefs": [

{ "bSortable": false, "aTargets": [-9] },

{ "width": "7%", "targets": 0 }

],

"oLanguage": {

"sLengthMenu": "Produtos de Locação por Página: _MENU_",

"sInfo": "_TOTAL_ Produtos de Locação",

"sInfoFiltered": "(Total: _MAX_ Produtos de Locação)"

},

"sDom": '<"top"fi>rt<"bottom"lp><"clear">',

"bPaginate": true,

"bDestroy": true*/

});

////here fnUpdate dont work --->

////tabela.fnUpdate( 'teste',0,0,false);

////tabela.fnDeleteRow( 0 ); ----> nor delete work

//// tabela.fnDraw();

}

</script>

相关阅读:
Top