title: In JQGrid add onclick event on img
body: <p>I'm very new to JQuery, and I'm having some trouble</p>
  
  <pre><code>function Clients(guid)
  {
   var that = this;
  
  this.guid = guid;
  this.container = $("#Clients_" + that.guid);
  
  this.LoadClients = function () {
   var ids = that.container.find("#clients-tbl").getDataIDs();
  
      for (var i = 0; i &lt; ids.length; i++) {
          var row = that.container.find("#clients-tbl").getRowData(ids[i]);
  
          var imgView = "&lt;img src='../../Content/Images/vcard.png' style='cursor:pointer;' alt='Open case' onclick=OnClickImage(" + ids[i] + "); /&gt;";
  
          that.container.find("#clients-tbl").setRowData(ids[i], { CasesButtons:  imgView });
      }
  }
  
  
  this.CreateClientsGrid = function () {
      var clientsGrid = that.container.find("#widget-clients-tbl").jqGrid({
  .....
   ondblClickRow:function(rowid)
  {
     ---
  }
    loadComplete: function () {
              that.LoadClients();
  
  
          }
   }
   this.OnClickImage=function(idClient){
    ....
   }
  
   this.Init = function () {
      that.CreateClientsGrid();
  };
  
  this.Init();
  }
  </code></pre>
  
  <p>The problem is with onclick, because OnClickImage is not global function.
  How can I use OnClickImage function?</p>