jqgrid showlink for nested class
<p>I am trying to use the showlink for a second domain class, called location, I have which is nested within my first domain class. What I am trying to do is that when i click on the data in the grid in the location column it is suppose to take me to my show.gsp for location.</p>

<p>The problem I have with it is that it does take me to the show page for location, but it takes the index of what row it is in and tries to point to that show. For example, in row 7, I click on the link in the location column. While the  index of the location in my location list would be 2, it points to 7 which is the row index and shows me the details of the location at index 7 in the location list.</p>

<p>What i am trying to figure out is how to change my showaction line so that it points to the correct location when I click on the hyperlink that points to location.</p>

<p>I am using jqgrid 3.8.0.1</p>

<p>Here is what I have for my jqgrid javascript.</p>

<pre><code>&lt;script type="text/javascript"&gt;
$(document).ready(function() {//code goes here
    jQuery("#allRoster").jqGrid({
        heigth: 'auto', //height of the grid
        width: '1000', // width of the grid
        caption: 'Roster List', //Title for the grid
        url: 'listAllRoster', //loaction in where the data for the grid is comiing from. The controller you use to initialize the grid data.
        editurl:'editAllRoster', //same as the url command, points to the controller editAllRoster to tell the edit column what to do when editting the rows.
        datatype: "json", //the type of data processing through the grid.
        colNames: ['','Name', 'Position', 'Department', 'Location'], // The column titles you want to use for the grid
        colModel: [ //The parameters for the data going through each column.
            //This empty column is a column that holds both the edit and delete button.
            {name:'actions', index:'actions', search:false, sortable:false, title:false, editable:false, required:false, sortable:false, width:"20",
                formatter: 'actions', hidden:false, formatoptions: {
                keys: true, editbutton: true, delbutton: true}
            },
            {name:'name', width:200,editable:false, sortable: true, formatter:'showlink',formatoptions: {baseLinkUrl:'../roster/', showAction:'show'},title:false},
            {name:'position', width:200, editable:true},
            {name:'department', width:200, editable:true},
            {name:'location', width:200,editable:false ,title:false, formatter: 'showlink', formatoptions: {baseLinkUrl: '../location/' ,showAction:'show'}}
        ],

        rowNum:10, //amount of rows you want to start off when the grid is called

        rowList:[10,20,40,60], //the size of the number of rows you want to hold
        gridview: true, //allows you to see the grid, not sure if absolutley neccessary
        viewrecords: true, //same for gridview
        sortname: 'name',//when grid is inialized what you want the rows to be sorted by.
        sortorder: "asc",//if the sorting order from sort name are in asceding order or not.
        autowidth:true, //the width of the column holding the data to be auto.
        forceFit:true,
        shrinkToFit: true,
        pager: '#rosterAllPager',
        scrollOffset:0,
        gridComplete: function() {
        }
    });
</code></pre>

<p>The line i am having a problem with is this line:</p>

<pre><code> {name:'location', width:200,editable:false ,title:false, formatter: 'showlink', formatoptions: {baseLinkUrl: '../location/' ,showAction:'show'}}
</code></pre>

<p>Here is what i am seeing.
<a href="http://i.stack.imgur.com/GnVvg.png" rel="nofollow">Roster Grid</a></p>

<p>In my grid, row 1 and 2 have the same location, but when i click on the second row I get the location New York rather than LA. Also if I try to click on the third row, I get a blank screen, because a third location does not exist.</p>

<p>Here is an image of the list of locations.
<a href="http://i.stack.imgur.com/Gls0C.png" rel="nofollow">List of Locations</a></p>