Update data on the server
Update data on the server
I'm sorry to distract you from important things! I learned how to make changes to the selected lines:
var selected_rows = table.rows( { selected: true } );
selected_rows.every(function (rowIdx, tableLoop, rowLoop) {
table.cell(rowIdx, 6).data("test");
})
.draw();
But I can't understand it for several hours (I reread the documentation) how to update this data on the server. Help please.
This question has an accepted answers - jump to answer
Answers
Yep,
cell().data()
only changes data in the table. To update on the server, you'll need to use the Editor API, methods such asedit()
.This example from this thread should get you going, as it's demonstrating that.
Hope that helps,
Colin
Thank you very much, Colin!
Colin, thank you, I used your example. Here's what I did:
But for some reason, the field value is set only in the first line (even if a lot is selected), although the cycle passes normally through all the selected lines! Please take a look, what's wrong?
That looks like it should work, as it's basically the same code in the example that I posted. Are you able to link to your page, or update my test from before, so we can debug this, please.
Colin
Mysticism! Look, this is a test page (the button at the bottom is on the left):
http://www.a0250268.xsph.ru/index.php
HTML
JS
PHP
Its interesting that after selecting two rows only the first is submitted to the server - seeing this in the network inspector. The problem might be that you are loading jquery twice which is generally not recommended. On line 39 you have this:
The bundled datatables include you have on line 100 also includes jquery:
You can open the link in the include file to regenerate the bundle without jquery. Let us know if this helps.
Kevin