Forum

July 10th, 2011
You must be logged in to post Login Register

Search Forums:


 






Form Editing DelGridRow – Adding Additional Row Data

UserPost

23:38
08/05/2012


brandonkirsch

Ohio

Member

posts 9

Post edited 18:34 – 09/05/2012 by brandonkirsch


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(); });

21:29
09/05/2012


brandonkirsch

Ohio

Member

posts 9

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.


About the jQuery Grid Plugin – jqGrid forum

Most Users Ever Online:

157


Currently Online:

OlegK

80 Guests

Forum Stats:

Groups: 1

Forums: 7

Topics: 9579

Posts: 28750

Membership:

There are 10070 Members

There have been 448 Guests

There is 1 Admin

There are 2 Moderators

Top Posters:

OlegK – 1157

markw65 – 179

kobruleht – 144

phicarre – 126

YamilBracho – 124

Renso – 118

Administrators: admin (56 Posts)

Moderators: tony (6999 Posts), Rumen[Trirand] (81 Posts)




Comments are closed.
Privacy Policy   Terms and Conditions   Contact Information