title: jqGrid: Sending param with dataUrl
body: <p>I'm trying to create a dependent dropdown box. 'element' is dependent on 'grouping'. </p>
  
  <p>My ajaxSelectOptions function seems to work, as 'temp' is passed, but then it isn't used by 'populate_element'. How can I use the 'temp' as my parameter :id?</p>
  
  <p>My grid:</p>
  
  <pre><code>jQuery(document).ready(function(){
  var lastsel;
  var grid = jQuery("#list").jqGrid({
  
  url:'codes/get_data.xml',
  datatype: 'xml',
  mtype: 'GET',
  colNames:['ID', 'Version', 'Grouping', 'Element', 'Name'],
  colModel:[
      {name: 'id', index: 'id', hidden: true, editable: false },
      {name: 'version', index: 'version',editable: true, editrules:{number:true}, cellEdit: true, search:true },
      {name: 'grouping', index: 'grouping', editable: true, edittype: 'select', editoptions: {dataUrl: 'codes/populate_grouping.html'} },
      {name: 'element', index: 'element', editable: true, edittype: 'select' }
  ],
  pager: '#pager',
  rowNum:200,
  rowList:[50,100,200],
  sortname: 'id',
  sortorder: 'asc',
  viewrecords: true, 
  height: 500,
  scrollrows: true,
  rownumbers: false,
  caption: 'GL Codes',
  editurl: 'codes/post_data.xml',
  
  onSelectRow: function(id){
      $("#list").setColProp('element', {editoptions: { dataUrl: 'codes/populate_element.html' }});
  
      if(id &amp;&amp; id!==lastsel){
          $('#list').restoreRow(lastsel);         
         lastsel=id;
      }
      $('#list').editRow(id,true);        
  },
  ajaxSelectOptions: {
        data: {
          temp: function(temp){
            return grid.jqGrid('getGridParam', 'selrow')
          } 
        }
      }
  
  });
  </code></pre>
  
  <p>Here is my error message:</p>
  
  <pre><code>Started GET "/codes/populate_element.html?temp=4" for 127.0.0.1 at 2012-09-27 17:18:33 +1200
  Processing by CodesController#populate_element as HTML
    Parameters: {"temp"=&gt;"4"}
  Completed 500 Internal Server Error in 1ms
  
  ActiveRecord::RecordNotFound (Couldn't find Code without an ID):
  app/controllers/codes_controller.rb:73:in `populate_element' 
  </code></pre>
  
  <p><strong>Update</strong>
  I established that it was actually just a ruby syntax error in calling the param, rather than a jqGrid problem. For reference, I ended up calling it like so ... @code = Code.where(["id = ?",params[:temp]]).first    </p>