Update row cell
Update row cell
Good afternoon.
I have a function where, on successful completion, I remove the specific line, as per the code below:
table.row($('#object_'+id).parents('tr')).remove().draw();
However, I have another one that does an update and, on success, I need to update the specific line in a certain cell.
How do I do this?
This discussion has been closed.
Replies
You can use
cell().data()to update a particular cell. Or you can userow().data()and update the particular column with the row of data.Kevin
I can't find a valid example and I'm not getting it right.
I'm trying it this way, but I don't know where it's wrong:
var id = table.row($('#object_'+id).parents('tr')).index();
table.cell({row:id, column: 1}).data(data.nomeE).draw();
Its hard to say specifically what you need to do without a test case showing what you have and what cell you want to update. For example we don't know what the result of
var id = table.row($('#object_'+id).parents('tr')).index();.is and if its appropriate for therow-selector.Instead of
table.cell({row:id, column: 1})trytable.cell({id, 1}). You can either usecell-selectoror pass in the row and column usingrow-selector,column-selector. I don't think{row:id, column: 1}is a valid option.See this simple example:
http://live.datatables.net/dayucisi/1/edit
Kevin
I achieved !
var idT = table.row($('#object_'+id).parents('tr')).index();
table.cell({row:idT, column:2}).data(nomeE).draw(false);
I was using the variable id, which I was already using above to send in the data, so I changed it to idT
Thanks again for your willingness.... God bless you all !!!!