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_Related Related Topics sp_TopicIcon
Form Editing DelGridRow - Adding Additional Row Data
08/05/2012
23:38
Avatar
brandonkirsch
Ohio
Member
Members
Forum Posts: 9
Member Since:
27/04/2012
sp_UserOfflineSmall Offline

Hi Everyone,

I am struggling to add some additional information to the AJAX request when using Form Editing + Navgrid + the default "Delete" button for the navgrid.

When I try to submit the default "Delete Row" action, I get RowID and oper: del in the AJAX request.  I want to extend the AJAX request to include the values for each column in the deleted row.  However, because Form Editing is enabled, $.jqGrid.getRowData(rowID) is returning colName : stringOfHTML instead of colName:colValue.

Can anyone suggest a clean way to obtain all of the column values for the row when submitting "Delete" operations?

Thanks,

Brandon

EDIT:  The strings of HTML for the input elements don't even have "value" attributes, so is it completely impossible to get at the values of an inline-edit row?  May have to go back to good ol' jQuery itself to pull the values from the "live" inputs:

$(rowID).find('[id^='+rowID+']').each(function(i,e){ e = $(e); localRows[e.attr('name')] = e.val(); });
09/05/2012
21:29
Avatar
brandonkirsch
Ohio
Member
Members
Forum Posts: 9
Member Since:
27/04/2012
sp_UserOfflineSmall Offline

I found a more elegant solution in a response from Tony in another thread.  There is a savedRow object that is created you first active Inline Editing that stores the original values in the row.  They are used to restore the row back to its original state in case the user cancels the operation.

The trick to access the savedRow object is this:

$('#YourJQGridID').jqGrid('getGridParam','savedRow')

This returns an object of { colModelName : originalCellValue, ... } that you should be able to use in an onclickSubmit handler.

Forum Timezone: Europe/Sofia

Most Users Ever Online: 715

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