Hi, this might help:
var grid = $('#mygrid');
//Commit any row changes
if (grid.datagrid.endEdit()) {
grid.datagrid('acceptChanges');
}
var items = grid.datagrid('getRows'); //Get all grid rows and submit as array
$.post('url/to/save', {items: items}, function(r){
if(r=='success'){
//Response success code here
}else{
//Response Error here
}
});
In php you simply can get the data with $_POST['items']. It's array so you can loop it to save to database.
$items = $_POST['items'];
foreach ($items as $key => $item) {
//Process insert to table here $item['product'], $item['price'] and so on
}
echo 'success'; //Inform status back to browser