title: jqGrid Radio Button select single row
body: <p>I have JqGrid with RadioButton per each row like this.</p>
  
  <pre><code>  ...
   { name: 'select', label: 'select', width: 50, formatter:radio}
  </code></pre>
  
  <p>and function for radio formatter: </p>
  
  <pre><code>function radio(value, options, rowObject){
     var radioHtml = '&lt;input type="radio" value=' + value + ' name="radioid" /&gt;';
     return radioHtml;
  }
  </code></pre>
  
  <p>when I try to select a singlerow  from the jqgrid i.ee., radio button which is only selected using this function:</p>
  
  <pre><code>  $(function () {
     $("#&lt;%=editButton.ClientID%&gt;").click(function () {
         var ids = $("#table").jqGrid('getCol', 'select', true);
         alert(ids)
         for (var i = 0; i &lt; ids.length; i++) {
             //alert(ids[i].id)
             if (ids[i].id != '') {
                 var idx = $("#table").jqGrid('getCell', ids[i].id, 'select');
             }
            // alert(idx);
         }
     });
   });
  </code></pre>
  
  <p>Am getting all the rows available in the grid rather than single selected row.</p>
  
  <p>The same function works well if formatter is checkbox but not for radio. Is there something  missing?</p>
  
  <p>UPDATE:</p>
  
  <pre><code>   colModel: [
                       { name: 'select', label: 'select', width: 50,
                           formatter: function radio(cellValue, option) {
                               return '&lt;input type="radio" name="radio_' + option.gid +       '"  /&gt;';
                           } 
                       },
                       { name: 'code', label: 'Branch Code', width: 250 },
                       { name: 'name', label: 'Branch Name', width: 250 },
                       { name: 'status', label: 'Group Status', width: 250 },
                  ],
  </code></pre>
  
  <p>Function Click Handler:</p>
  
  <pre><code>     $("#&lt;%=editButton.ClientID%&gt;").click(function () {
              alert('M');
              var $selRadio = $('input[name=radio_' + $table[0].id + ']:checked'), $tr;
              alert('I');
              if ($selRadio.length &gt; 0) {
                  $tr = $selRadio.closest('tr');
                  if ($tr.length &gt; 0) {
                      alert("The id of selected radio button is " + $tr.attr('id'));
                  }
              } else {
                  alert("The radio button is not selected");
              }
          });
  </code></pre>