JQGRID: grid and subgrid combination
<p>I have some difficulties implementing the subgrid feature.</p>

<p>*<em>Problem: *</em> when I select, for example, the second row in a subgrid, than the second row of the main grid is also selected?!?
How can I solve this or what am I doing wrong?</p>

<p>*<em>Code: *</em></p>

<pre><code>jQuery('#compoundGrid').jqGrid({
        datatype: 'json',
        mtype: 'GET',
        colNames: ['Batch ID', 'Compound ID', 'Compound number', 'Generic name', 'Compound name', 'Batch number', 'Re-evaluation date', 'Attention', 'Attention reason'],
        colModel: [ 
            {name: 'batchId', index: 'batchId', hidden: true},
            {name: 'compoundId', index: 'compoundId', hidden: true},
            {name: 'compoundNumber', index: 'compound.jnjNumber', width: 150},
            {name: 'compoundGenericName', index: 'compound.genericName', width: 150},
            {name: 'compoundName', index: 'compound.name', width: 150},
            {name: 'batchNumber', index: 'batch.batchId', width: 125},
            {name: 'dynamicDate', index: 'batch.dynamicDate', width: 125, align: 'center'},
            {name: 'attentionActive', index: 'attentionActive', width: 60, align: 'center', sortable: false, formatter: formattedAttention},
            {name: 'attentionReason', index: 'attentionReason', hidden: true}
        ],
        pager: jQuery('#gridNavigator'),
        rowNum: 10,
        rowList: [10, 20, 30, 40, 50],
        sortname: 'compound.jnjNumber',
        sortorder: 'desc',
        viewrecords: true,
        height: 210,
        width: 955,
        jsonReader: {
            repeatitems: false
        },
        subGrid: true,          
        subGridRowExpanded: function(subgrid_id, rowId) {

            var subgrid_table_id = subgrid_id + "_t";
            var rowData = jQuery('#compoundGrid').jqGrid('getRowData', rowId);

            jQuery("#" + subgrid_id).html("&lt;table id='" + subgrid_table_id + "' class='scroll'&gt;&lt;/table&gt;");
            jQuery("#" + subgrid_table_id).jqGrid({
                url: '/cstim/weborder/search/relatedCompounds?compoundId=' + rowData.compoundId,
                datatype: "json",
                mtype: 'GET',
                colNames: ['Compound number'],
                colModel: [
                    {name: "compoundNumber", index: "compoundNumber", width: 150, sortable: false}
                ],
                height: '100%',
                width: '800',
                jsonReader: {
                    repeatitems: false
                }
            });
        }
    });
</code></pre>
