Forum


12:51

31/12/2008

I have searched the forums and have not been able to find an answer to this question, even though I am sure I am not the first to encounter this issue.
I noticed that you have to set each field as "editable" in order to have jqGrid post the value back to the server. So, I have the make the primary key editable in order to make inline editing work, so I know which record to update on the server side.
I was OK with this, but then they asked me to add a delete feature. I have noticed that the value of editable text fields comes back looking something like "<input class="editable" name="ftevalue" id="1_ftevalue" style="width: 99%;" type="text">". If you make the field non-editable, you get back the actual value of the field.
So, if I make the ID field non-editable, the delete feature works (because the value will come back properly), but now my inline editing is broken!
Please help!
13:17

29/12/2008

When using inline editing you can add handlers for any of events listed in the documentation (Cell Editing -> Events) (http://www.secondpersonplural....../index.htm)
Nearly all of these events provide the following to your handler:
I am doing exactly this in my own implementation. I do not display the ID column at all. I simply reference the rowid provided to tell me the ID corresponding to the data I am saving/deleting.
Hope this helps!
09:57

31/12/2008

geek said:
I am doing exactly this in my own implementation. I do not display the ID column at all. I simply reference the rowid provided to tell me the ID corresponding to the data I am saving/deleting.
Hmmm actually I don't get it. How are you using the rowid to get the real ID? Maybe you can post an example?
15:10

29/12/2008

The rowID is the real ID. When setting up your grid you specify what the ID is. In my case, I am using an xmlReader which looks like this:
xmlReader: {
root: "DocumentElement",
row: "Table1" ,
page: "DocumentElement>currentpage",
total: "DocumentElement>totalpages",
records: "DocumentElement>totalrecords",
repeatitems: false,
id: "guidBranch"
}
You can alternatively specify the ID by using the key property in your colModel definition like this:
colModel: [
{name:'guidBranch' ,index:'guidBranch', key=true},
]
At this point, when any of the aforementioned events are fired (i.e. afterSaveCell) the rowID passed in this even is your "real" ID which is presumably your primary key.
Hopefully this helps, again 🙂
08:04

Moderators
30/10/2007

Hello,
I do not understand right what is used - inline editing or cell editing? Both are diffrent things.
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.
Most Users Ever Online: 715
Currently Online:
42 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