Forum


03:04

16/02/2009

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..
08:07

Moderators
30/10/2007

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.
11:34

16/02/2009

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.
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.comModerators: tony: 7721, Rumen[Trirand]: 81
Administrators: admin: 66