title: Pass Id to a Onclick Function JQGrid
body: <p>I have a JQGrid.I need to take some Id to the OnClick function.In my scenario i wanted to get BasicId to the OnClick function.</p>
  
  <p>MyCode</p>
  
  <pre><code> function grid() {
      //JqGrid
      $('#griddata').html('&lt;table class="table" id="jqgrid"&gt;&lt;/table&gt;')
      $('#jqgrid').jqGrid({
  
          url: '/Admin/GetBasicData/',
  
          datatype: 'json',
          mtype: 'GET',
          //columns names
          colNames: ['BasicId','Images'],
          //columns model
          colModel: [
  
                      { name: 'BasicId', index: 'BasicId', resizable: false },
  
  
                       {
                           name: 'Images',
                           width: 120,
  
                           formatter: function () {
                               return "&lt;button class='btn btn-warning btn-xs' onclick='OpenDialog()' style='margin-left:30%'&gt;View&lt;/button&gt;";
                           }
                       },
  
  //Some Code here
  </code></pre>
  
  <p>Open Dialog Function</p>
  
  <pre><code>function OpenDialog(BasicId)
  {
  //Some code here
  }
  </code></pre>