Forum

November 2nd, 2014
A A A
Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

The forums are currently locked and only available for read only access
sp_Feed Topic RSS sp_Related Related Topics sp_TopicIcon
Cell Edition: event in which I can cancel the edition before it's sent to server-side
25/01/2013
17:08
Avatar
newUserId
Member
Members
Forum Posts: 4
Member Since:
25/01/2013
sp_UserOfflineSmall Offline

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.

28/01/2013
15:23
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

28/01/2013
15:30
Avatar
newUserId
Member
Members
Forum Posts: 4
Member Since:
25/01/2013
sp_UserOfflineSmall Offline

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?

28/01/2013
16:09
Avatar
tony
Sofia, Bulgaria
Moderator
Members

Moderators
Forum Posts: 7721
Member Since:
30/10/2007
sp_UserOfflineSmall Offline

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.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 496

Currently Online:
20 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.com

Moderators: tony: 7721, Rumen[Trirand]: 81

Administrators: admin: 66

Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information