Forum



00:14

23/01/2010

Is there a way to reload only one row from the server?
I am using Cell Editing, and after editing some cells, I need to reload the entire row of data. (To see updated data from server.)
Can this be done automatically with Cell Editing?
If not, is there a method to reload one row from the server?
Thanks,
Glen
11:36

Moderators
30/10/2007

Hello,
Not sure if this can be done automatically from the grid
Regards
For professional UI suites for Java Script and PHP visit us at our commercial products site - guriddo.net - by the very same guys that created jqGrid.
20:00

27/05/2010

Hi,
Perhaps you can use a grid event like afterSubmitCell. Using the rowid of the event, you can do a request to the server to get the latest data. Would that work for you?
If you are not submitting to the server, you could use afterSaveCell and then from there do a request to the server?
After getting the data you can use the method setRowData.
I Hope this helps.
21:01

23/01/2010

Thanks for the advice...
I now track which cell I am editing in the "beforeEditCell" and save the info in a global variable:
beforeEditCell: function (rowid, cellname, value, iRow, iCol) { _cellInEdit = { row: iRow, col: iCol }; }
I then use "afterSubmitCell" and, when needed, call:
grid.setRowData(rowid, info.Data, null);
to set the data for the entire row to the new data I just got from the server in "info.Data".
In "afterSubmitCell" I also determine if the "_cellInEdit" is different from the one the "afterSubmitCell" was submitting. If it is different, user must have moved from one input cell to another... In that case, I restore the cell (sinces its value may have changed).
var newRow = _cellInEdit.row;
var newCol = _cellInEdit.col;
if (newRow != iRow || newCol != iCol) {
setTimeout('$("#results").restoreCell(' + newRow + ', ' + newCol + ')', 0);
}
Most Users Ever Online: 715
Currently Online:
69 Guest(s)
Currently Browsing this Page:
2 Guest(s)
Top Posters:
OlegK: 1255
markw65: 179
kobruleht: 144
phicarre: 132
YamilBracho: 124
Renso: 118
Member Stats:
Guest Posters: 447
Members: 11373
Moderators: 2
Admins: 1
Forum Stats:
Groups: 1
Forums: 8
Topics: 10592
Posts: 31289
Newest Members:
, razia, Prankie, psky, praveen neelam, greg.valainis@pa-tech.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66