title: How to pass form data and jqGrid (editUrl) data to Controller at same time
body: <p>I have an asp.net MVC3 app with various bits of form data and a jqGrid.</p>
  
  <p>When I edit a row in the jqGrid I need to post the grid data as well as some of the form pieces to the editUrl controller.</p>
  
  <p>I can post the jqGrid edited data to my controller through the editUrl just fine.</p>
  
  <p>Is there a way to do this?</p>
  
  <p>Im not sure how to send the other form elements and how to receive them in my controller.</p>
  
  <p>Any help will be greatly appreciated.</p>
  
  <p>Below is my jqGrid:</p>
  
  <pre><code>    $("#jqTable").jqGrid({
          // Ajax related configurations
          url: '@Url.Action("_CustomBinding")',
          datatype: "json",
          mtype: "POST",
          postData: {
              programID: function () { return $("#ProgramID option:selected").val(); },
              buildID: function () { return $('#Builds option:selected').val(); }
          },
  
          // Specify the column names
          colNames: ["Actions", "Assembly ID", "Assembly Name", "Assembly Type", "Cost", "Order", "Budget Report", "Partner Request", "Display"],
  
          // Configure the columns
          colModel: [
          { name: 'myac', width: 80, fixed: true, sortable: false, resize: false, formatter: 'actions', formatoptions: { keys: true} },
          { name: "AssemblyID", key: true, index: "AssemblyID", width: 40, align: "left", editable: false },
          { name: "AssemblyName", index: "AssemblyName", width: 100, align: "left", editable: true, edittype: 'select',
              editoptions: {
                  dataUrl: '@Url.Action("_Assemblies")',
                  buildSelect: function (data) {
                      var response = jQuery.parseJSON(data);
                      var s = '&lt;select&gt;';
                      if (response &amp;&amp; response.length) {
                          for (var i = 0, l = response.length; i &lt; l; i++) {
                              var ri = response[i];
                              s += '&lt;option value="' + ri + '"&gt;' + ri + '&lt;/option&gt;';
                          }
                      }
                      return s + "&lt;/select&gt;";
                  }
              }
          },
          { name: "AssemblyTypeName", index: "AssemblyTypeName", width: 100, align: "left", editable: false, edittype: 'select' },
          { name: "AssemblyCost", index: "AssemblyCost", width: 50, align: "left", formatter: "currency", editable: true },
          { name: "AssemblyOrder", index: "AssemblyOrder", width: 50, align: "left", editable: true },
          { name: "AddToBudgetReport", index: "AddToBudgetReport", width: 100, align: "center", formatter: "checkbox", editable: true, edittype: 'checkbox' },
          { name: "AddToPartnerRequest", index: "AddToPartnerRequest", width: 100, align: "center", formatter: "checkbox", editable: true, edittype: 'checkbox' },
          { name: "Show", index: "Show", width: 50, align: "center", formatter: "checkbox", editable: true, edittype: 'checkbox'}],
  
          // Grid total width and height and formatting
          //width: 650,
          //height: 220,
          altrows: true,
  
          // Paging
          //toppager: true,
          pager: $("#jqTablePager"),
          rowNum: 10,
          rowList: [10, 20, 30],
          viewrecords: true, // Specify if "total number of records" is displayed
          emptyrecords: 'No records to display',
  
          // Default sorting
          sortname: "AssemblyID",
          sortorder: "asc",
  
          // Grid caption
          caption: "Build Template",
  
          // grid command functionality
          editurl: '@Url.Action("_AjaxUpdate")',
          onSelectRow: function (AssemblyID) {
              if (AssemblyID &amp;&amp; AssemblyID !== lastsel) {
                  $('#jqTable').jqGrid('restoreRow', lastsel);
                  $("#jqTable").jqGrid('editRow', AssemblyID, true);
                  lastsel = AssemblyID;
              }
          }
      }).navGrid("#jqTablePager",
          { refresh: false, add: false, edit: false, del: false },
              {}, // settings for edit
              {}, // settings for add
              {}, // settings for delete
              {sopt: ["cn"]} // Search options. Some options can be set on column level
       );
  </code></pre>