You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Editing multiple cells of a table with remote data does not work properly when the server does not respond quickly enough.
I noticed the following when sending multiple edit request on different cells before their processing by the server:
The requests received by the server are corrupts: The "id" is always the same when editing different cells and the "value" is not always the right value
The processing of the server's response does not update the right cell with the right value: the first cell edited is cleared and the following cells are either cleared or display a wrong value
The editing of the same cell multiple times does not work properly either.
I managed to fix this bug in the version 5.5.4 by updating the "saveCell" function by using the parameter "iRow" instead of the value "$t.p.savedRow[fr].rowId" and by removing the right element in the "$t.p.savedRow" array:
...
// var trow = $($t).jqGrid("getGridRowById", $t.p.savedRow[0].rowId),
var trow = $($t).jqGrid("getGridRowById", iRow),
...
// postdata[idname] = $.jgrid.stripPref($t.p.idPrefix, $t.p.savedRow[fr].rowId);
postdata[idname] = $.jgrid.stripPref($t.p.idPrefix, iRow);
...
$(cc).empty();
//$($t).jqGrid("setCell",$t.p.savedRow[fr].rowId, iCol, v2, false, false, true);
$($t).jqGrid("setCell",iRow, iCol, v2, false, false, true);
cc = $('td', trow).eq( iCol );
$(cc).addClass("dirty-cell");
$(trow).addClass("edited");
// $($t).triggerHandler("jqGridAfterSaveCell", [$t.p.savedRow[fr].rowId, nm, v, iRow, iCol]);
$($t).triggerHandler("jqGridAfterSaveCell", [iRow, nm, v, iRow, iCol]);
if ($.jgrid.isFunction($t.p.afterSaveCell)) {
// $t.p.afterSaveCell.call($t, $t.p.savedRow[fr].rowId, nm, v, iRow,iCol);
$t.p.afterSaveCell.call($t, iRow, nm, v, iRow,iCol);
}
// Adding a processing for removing the right element in the array "$t.p.savedRow"
var indexOfSavedRowBeingProcessed = -1;
for (var savedRowIterator of $t.p.savedRow)
{
if (savedRowIterator.rowId == iRow && savedRowIterator.ic == iCol)
{
indexOfSavedRowBeingProcessed = $t.p.savedRow.indexOf(savedRowIterator);
}
}
if (indexOfSavedRowBeingProcessed !== -1)
{
$t.p.savedRow.splice(indexOfSavedRowBeingProcessed, 1);
}
// $t.p.savedRow.splice(0,1);
...
The text was updated successfully, but these errors were encountered:
Apologize for the late answer. The problem lie in the how the ajax is using. We use ajax complete instead of success which causes this delay. We plan to rewrite this code to use ajax success, but this is not a trivial task, because of the existing users.
Using the iRow in place of rowId is not a good solution for all existing users.
An example project can be found here : https://jsfiddle.net/nducoin/ue0kyxtz/4/
Editing multiple cells of a table with remote data does not work properly when the server does not respond quickly enough.
I noticed the following when sending multiple edit request on different cells before their processing by the server:
The editing of the same cell multiple times does not work properly either.
I managed to fix this bug in the version 5.5.4 by updating the "saveCell" function by using the parameter "iRow" instead of the value "$t.p.savedRow[fr].rowId" and by removing the right element in the "$t.p.savedRow" array:
The text was updated successfully, but these errors were encountered: