title: How to load Values into the edit-form of jqGrid when user select from select box
body: <p><br>
  In the edit Form is a select dropdown. When the user select an item, i want to load some values and fill them into the form.</p>
  
  <p>My code so far:</p>
  
  <pre><code>var grid = $("#list").jqGrid({
    parameters...,
    colNames:[...],
    colModel :[
      ...
    ]
  });  
  
  $("#list").jqGrid(
    'navGrid',
    '#pager',
    {
      view:true,
      edit:true,
      del:true,
      search:false,
    },
  
    /* EDIT */
    {
      closeAfterEdit: true,
      afterSubmit: processAddEdit,
      onInitializeForm: setFormEvents,
      ...
    }
    ...
  );
  
  
  function setFormEvents(formid) {
    /* It sometim works when using timeout..
     * It seems to be a timing issue.
     * But i have no idea why and how to solve
     */
    setTimeout ( function(){
      $('select#data_id', formid).unbind();
      $('select#data_id', formid).change(function() {
        $.getJSON("/URL?dataid=" + $('select#data_id option:selected').val(),
          function(data){
            $.each(data, function(i,item){
              if (item.field == "anrede") { $("#anrede").val(item.value); }
              else if (item.field == "titel") { $("#titel").val(item.value); }
              else if (item.field == "vorname") { $("#vorname").val(item.value); }
              else if (item.field == "nachname") { $("#nachname").val(item.value); }
              else if (item.field == "firma") { $("#firma").val(item.value); }
              else if (item.field == "strasse") { $("#strasse").val(item.value); }
              else if (item.field == "hausnummer") { $("#hausnummer").val(item.value); }
              else if (item.field == "plz") { $("#plz").val(item.value); }
              else if (item.field == "ort") { $("#ort").val(item.value); }
              else if (item.field == "land") { $("#land").val(item.value); }
            });
          });
      });
    }, 1000 );
  }
  </code></pre>