Again thank you, but it don't work!
In my code to edit the grid I have been integrate the function to save the edited values to db.
My function saveChanges()
function saveChanges() {
var grid = $( ".selector" ).pqGrid( "getInstance" ).grid;
var changes = $( ".selector" ).pqGrid('getChanges');
$.ajax({
dataType: "json",
type: "POST",
async: true,
beforeSend: function (jqXHR, settings) {
$( ".selector" ).pqGrid( "showLoading" );
},
url: "Vormerkungen_Grid_Speichern.php",
data: { list: JSON.stringify(changes) },
success: function (changes) {
//grid.commit({ type: 'add', rows: changes.addList });
grid.commit({ type: 'update', rows: changes.updateList });
//grid.commit({ type: 'delete', rows: changes.deleteList });
//grid.history({ method: 'reset' });
},
complete: function () {
$( ".selector" ).pqGrid( "hideLoading" );
}
})
};
And my file to execute the Update-Statement
<?php
// https://paramquery.com/demos/editing_batch
// Datei dient nur zum Speichen von Veränderungen im Grid
require ('./system_connector_mysql.php');
$artikelnr = $_POST['ArtikelNr'];
$aufgabe = $_POST['Aufgabe'];
$prio = $_POST['Prio'];
console_log $_POST['ArtikelNr'];
console_log $_POST['Aufgabe'];
console_log $_POST['Prio'];
$query = "UPDATE tab_vormerkungen SET Aufgabe = '$aufgabe', Prio=$prio WHERE ArtikelNr=$artikelnr";
mysql_query($query) OR ('Vormerkungen_Speichern.php - Zeile 13 |' . mysql_error());
?>
I don`t see anything in the console as well in db. What ist wrong?