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_TopicIcon
celledit- submit without pressing enter
14/04/2011
22:10
Avatar
sudheerys
New Member
Members
Forum Posts: 2
Member Since:
14/04/2011
sp_UserOfflineSmall Offline

Hi all, 

     I have a jqgrid which has celledit enabled and a save button on my toolbar. Currently users have to enter a value in the field (in the grid) and then press enter before they can hit save. Failing to do so, instead of the value entered in the grid cell, the HTML code is being submitted(default behaviour of cell edit - confirm by hitting enter or cancel by hitting escape).

    Can I change this behaviour to submit the cell even if the user does not hit enter key. The moment user hits the save button the currently edited cell needs to be confirmed and the value needs to be submitted.

I am using jqgrid 3.8

Thanks in advance

Sudheer

16/04/2011
15:07
Avatar
mascott
Member
Members
Forum Posts: 19
Member Since:
15/04/2011
sp_UserOfflineSmall Offline

try this

onclick="jQuery('#your_id').jqGrid('saveRow', id);"

or this for cancel editing

onclick="jQuery('#list').jqGrid('restoreRow', id);"

19/04/2011
21:53
Avatar
sudheerys
New Member
Members
Forum Posts: 2
Member Since:
14/04/2011
sp_UserOfflineSmall Offline

Thanks for the suggestion, but saveRow works for inline editing, as far as I know, not for cell edit. 

Anyways, I solved my problem. I am giving the approach here for others:

1. declare two global variables irow and icol

2. in beforeeditcell set them to the row and col that is passed into the function

3. in aftersavecell, set irow and icol to 0(this is is when the user presses enter after editing)

4. in the click function of the save button, if the row and col are not 0 call the savecell using the irow and icol.

Thanks

Sudheer

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

Currently Online:
68 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