Forum
17:08
25/01/2013
Hi.
Is there any event of cell edition in which I can cancel the edit? I have only found that afterSubmitCell can do that, but I need to do it BEFORE it's sent to the server.
Something like if a user edits a particular cell, a dialog pops up asking to confirm the change, and if it clicks on Cancel, it cancels the edition; otherwise move on.
Thanks.
15:23
Moderators
30/10/2007
Hello,
You can use afterEditCell event.
In this event under some condition you can cancel edit it if you call restoreCell.
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.
15:30
25/01/2013
Hi, thanks for the answer.
The problem is that I have to launch a pop up asking the user for confirmation. In the afterCellEdit event, if I launch the dialog there, the flow will continue after the dialog is launched, not after the user selects its answer.
Is there any way to STOP the flow of the edition until the user answers the confirmation?
16:09
Moderators
30/10/2007
Hello,
The problem lie that you maybe call a modal dialog and a follow continue.
Maybe one not so perfect solution is to use beforeSelectRow (see docs for it)
$("#grid").jqGrid({
...
beforeSelectRow : function (rowid, event) {
// call your dialog function
MyDialog(rowid, event);
return false;
},
...
});
function MyDialog( rowid, event)
{
.....
if(some condition to edit or a button clicked) {
$("#grid").jqGrid('setGridParam',{cellEdit:true});
// get the iRow and iCol from event
$("#grid").jqGrid(editCell, iRow, iCol,true);
} else {
$("#grid").jqGrid('setGridParam',{cellEdit:false});
$("#grid").jqGrid('setSelection',rowid);
}
}
Note the return false
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.
Most Users Ever Online: 715
Currently Online:
53 Guest(s)
Currently Browsing this Page:
1 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