0

I am new to JQGrid and my objective is to redirect to a different page when user clicks on a hyperlink column cell in a jqgrid row. The content present inside this column would be common for each row. My colModel is as mentioned below

 { name: 'Edit', index: 'Edit', width: 130, align: "center", formatter: 'showlink', editable: true, resizable: true, formatoptions: { baseLinkUrl: 'EditUserDetails.aspx'} }

Now when i click on hyperlink, it is correctly redirecting to the specified page and by default in QueryString i get the rowid of the selected row but i want the value present in one of the columns for e.g. if I have two columns in my grid named UsedId and Edit, then on click of link, I should get the value of UserId present in the selected row in the QueryString. Can You Please guide me how to achieve this using JavaScript.

Rohit Agrawal
  • 483
  • 3
  • 12

1 Answers1

0

If you look at the documentation at http://www.trirand.com/jqgridwiki/doku.php?id=wiki:predefined_formatter

you will see you can include a idName parameter in your formatoptions: which would correspond to the row data you want to include which should solve your problem.

Another example is linked below of a similar question:

JqGrid need hyperlink - need to capture value through Jquery

Community
  • 1
  • 1
Mark
  • 3,123
  • 4
  • 20
  • 31
  • Thanks for replying but the idName parameter just gives the rowid of the selected, that anyways i was by default getting. The http://stackoverflow.com/questions/4390999/jqgrid-showlink link solved my query – Rohit Agrawal Sep 18 '13 at 18:31
  • @RohitAgrawal Did you specify a different column name with the `idName` parameter or use the `addParam` parameter? – Mark Sep 18 '13 at 18:51
  • Yes Mark I had specified idName='UserId', but still I was getting the rowId of the grid. – Rohit Agrawal Sep 19 '13 at 06:27