title: Can't get the object from a cell in jqGrid (jQuery)
body: <p>This is the issue, when I define the ddl (drop down list or select box) I don't know the selected value. When a user edits a row, the user can select an item from the list.  But the selected item isn't set. I want to set the selected item when the user clicks a button to edit the row.</p>
  
  <p>The proper way, I think, is to get the ddl that was created when the jqGrid was built and set the selected value.</p>
  
  <pre><code>$("#list").jqGrid({
    datatype: 'clientSide',
    colNames: ['Edit', 'Delete', 'Save', 'Cancel', 'Location'],
    colModel: [
               ....
               ....
          { name: 'Location', index: 'Location', width: 90, editable: true, edittype: "select", editoptions: { value: SI:System Integration ; IM:Information Management ; IA:Industrial Automation ; CI:Custom Instrumentation}}]
  });
  </code></pre>
  
  <p>When the user clicks the edit button I get the data from ddl list</p>
  
  <pre><code>var locationText = $("#list").getRowData(rowNum).Location;
  
  locationText  =    
  &lt;SELECT id=1_Location class=editable&gt;&lt;OPTION value="R         "&gt;Rochester&lt;/OPTION&gt;&lt;OPTION selected value="MA        "&gt;Massachusetts&lt;/OPTION&gt;&lt;OPTION value="DL        "&gt;Data Librarian&lt;/OPTION&gt;&lt;OPTION value="Buff      "&gt;Buffalo /  Niagara Falls&lt;/OPTION&gt;&lt;OPTION value="Bing      "&gt;Binghamton / Owego / Southern Tier&lt;/OPTION&gt;&lt;OPTION value="Other     "&gt;All other locations&lt;/OPTION&gt;&lt;OPTION value="Alb       "&gt;Albany and all points East&lt;/OPTION&gt;&lt;OPTION value=""&gt;&lt;/OPTION&gt;&lt;/SELECT&gt;
  </code></pre>
  
  <p>Instead of getting the data from the cell in the jqGrid I would rather get the dom ddl element object.</p>
  
  <p>The other idea I had, but don't think is right, is to use locationText and use that to create a new ddl dom element.</p>
  
  <p>something like this. </p>
  
  <pre><code>var locationTmp2 = document.createElement("select");
  locationTmp2.innerHTML = locationText;
  or 
  locationTmp2.text= locationText;
  </code></pre>
  
  <p>Is there an easy way to do what I'm trying to do.
  I know I could create a new dom select element then add each option to it, like this</p>
  
  <pre><code>        //populate and set the selected item for locations.
          var locationSelect = document.createElement("select");
          var arrayLocations = ('R:Rochester;MA:Massachusetts;DL:Data Librarian;Buff:Buffalo/Niagara Falls;Bing :Binghamton / Owego / Southern Tier;Other:All other locations;Alb:Albany and all points East;').split(";");
          for (var i = 0; i &lt; arrayLocations.length - 1; i++) {
              var optionItem = document.createElement("option");
              optionItem.value = trim(arrayLocations[i].split(":")[0]);
              optionItem.text = trim(arrayLocations[i].split(":")[1]);
              //check if this should be the selected item.
              if (arrayLocations[i].indexOf(rowData.Location) != -1)
                  optionItem.selected = true;
              locationSelect.add(optionItem);
          }
  </code></pre>
  
  <p>but there should be a way to grab the entire dom element from jqGrid.</p>
  
  <p>Thanks </p>