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
beforeEditCell
23/02/2009
03:04
Avatar
james_
Member
Members
Forum Posts: 27
Member Since:
16/02/2009
sp_UserOfflineSmall Offline

Hi!

Sorry but I don't quite understand how this one works..
beforeEditCell: function(id,name,val,iRow,iCol){

What I want to do is

1. Someone wants to edit a cell, and either clicks on it, uses enter or whatever
2. Before they get to edit the value, I want to change it using some logic (let's say it's a suggestion or something).
3. After they have decided what to save, I want to store that in the cell using afterSubmitCell or whatever, perhaps changing the value yet another time.

I've tried various approaches but it doesn't work :/ Am I able to control the editing this way?

I've tried return {val:'test'}; and such things like the other events use..

Btw everything is written locally to grid, no server involved here..

24/02/2009
08:07
Avatar
tony
Sofia, Bulgaria
Moderator
Members

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

Hello,

Use beforeEditCell to get the value of the cell before editing. Store this in variable and then use beforeSaveCell to go back to original value - if I understand right.

Regards

Tony

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.

24/02/2009
11:34
Avatar
james_
Member
Members
Forum Posts: 27
Member Since:
16/02/2009
sp_UserOfflineSmall Offline

Thanks Tony,

I understand this, but I want to decide the value of the input-element when the user clicks a cell, and also do something with when he saves. Example:

Value of cell  = 12 monkeys
User click on cell, and gets <input name="id-celll" type="text" value="12" />
User hits enter to save "13" and the new cell value = 13 monkeys

I can store the two values in separate tags to be able to identify them. Example:
<span id="number">12</span> <span id="text">monkeys</span>

I know I can use two cells but I really can't do that in this case.

28/02/2009
18:51
Avatar
james_
Member
Members
Forum Posts: 27
Member Since:
16/02/2009
sp_UserOfflineSmall Offline

Nobody knows if this is possible?

I basically want to decide the value of the input showing up in the cell, and alter the value before saving it (last part should be OK I think..

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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