title: How to load the data for a jqGrid using an Id from the URL parameter
body: <p>I can't seem to figure out how to load a jqGrid based on an Id from a parameter in the URL. Basically i have the address \Locations\Departmetn?LocationId=1 now i want to load the grid based on the location Id. The grid is just using the address \Locations\GetDepartments to get the controller to return the data as a jSonResult which is all working fine, I just dont know how/if i can send the location Id to that URL \Locations\GetDepartments</p>
  
  <pre><code>$(function () {
  
      $.widget('qs.department_page', {
  
      _create: function () {
  
          var self = this;
          this.scroll_to_end = false;
  
          var LocId = 1; //hardcoded for the test
  
          // get my child dom elements
          this.department_pager = $("#department_pager");
  
          // set up the grid and pager
          this.department_grid = $("#department_grid").jqGrid(
          {
              url: "/Location/GetDepartments/",
              datatype: "json",
              mtype: "POST",
              height: 300,
              hidegrid: false,
              colNames: ['Name', 'Site Num', 'Description', 'ABN'],
              colModel: [
                  { name: 'Name', index: 'Name', width: 200, align: "left", sortable: false },
                  { name: 'SiteNum', index: 'SiteNum', width: 100, align: "left", sortable: false },
                  { name: 'Company', index: 'Company', width: 200, align: "left", sortable: false },
                  { name: 'ABN', index: 'ABN', width: 200, align: "left", sortable: false }
              ],
              caption: "Departments",
              pager: this.department_pager
          })
          .navGrid('#department_pager', {
              addfunc: function () { self.onNewDepartment(); },
              editfunc: function (val) { self.onEditDepartment(val); },
              search: false,
              refresh: false
          },
              {/*add*/
              },
              {/*edit*/
              },
              { url: "/Location/DeleteDepartment" }
          );
  </code></pre>
  
  <p>}</p>