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
Inline editting, saveRow
29/10/2008
10:35
Avatar
nsorochan
Member
Members
Forum Posts: 17
Member Since:
29/08/2008
sp_UserOfflineSmall Offline

I am editing a grid and when I save the row, the id does not get passed to my controller code on the server. This is the only field which does not get passed. I tried making that field not hidden, but that does not work. All the other data gets passed through, Anyone with any ideas?

29/10/2008
10:59
Avatar
YamilBracho
Member
Members
Forum Posts: 124
Member Since:
08/09/2008
sp_UserOfflineSmall Offline

You can use the beforeSubmit event for the action you are executing and add any value to the editData  parameter. For example:

 // --- edit options ---
            { height:100,
              width:500,
              reloadAfterSubmit:false,
              beforeSubmit: function() {
                 var sr = jQuery("#list").getGridParam('selrow');
                 var rowData = jQuery("#list").getRowData(sr);
           
                  this.editData = {"co_motivo_desa" : rowData['co_motivo_desa']};
                  retarr = {"co_motivo_desa" : rowData['co_motivo_desa']};
                  return retarr;
              }

Here I am just adding "co_motivo_desa" to the request...

HTH

29/10/2008
11:07
Avatar
nsorochan
Member
Members
Forum Posts: 17
Member Since:
29/08/2008
sp_UserOfflineSmall Offline

thanx,

Here is the really strange thing, the id is in the post to the server. When the request hits the controller method, the id is an empty string.

I have tried everything I could think of. I appreciate the response, but I would really like to know what I am doing wrong.

Does my method need a certain return type?

29/10/2008
11:26
Avatar
YamilBracho
Member
Members
Forum Posts: 124
Member Since:
08/09/2008
sp_UserOfflineSmall Offline

The problem is receiving the parameter or building response for jqGrid ?

29/10/2008
12:16
Avatar
nsorochan
Member
Members
Forum Posts: 17
Member Since:
29/08/2008
sp_UserOfflineSmall Offline

Receiving the parameter.

When I look at the actual http post, the id is in there.
My method on my controller looks like this

public JsonResult EditClients(string address, string clientdescription, string clientname, string contactname, string contactnumber, string country, string id, string province)

Everything has a value except id, it is empty.

I got around though, in the

29/10/2008
12:45
Avatar
YamilBracho
Member
Members
Forum Posts: 124
Member Since:
08/09/2008
sp_UserOfflineSmall Offline

Please, add the beforeSubmit event as above and put the id getting the value from the row selected.

If this field is your PK, you know it will be empty if you are adding a new record, otherwise it shouble have the value from the selected row

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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