title: Updating value in jqGrid doesn't work when two columns use same field
body: <p>I used the solution mentioned in <a href="https://stackoverflow.com/questions/9145163/how-to-update-value-of-data-in-jqgrid">How to update value of data in jqgrid</a> to update data locally. It worked for me as shown in the first fiddle. In the "Action" column, there is button added conditionally, based on the data in "IsActive" column. If it is "true", a "Retire" button gets added as an action. If it is false, "Activate" button gets added. When the javascript function is called, the button changes to "Activate".</p>
  
  <p><a href="https://jsfiddle.net/LijoCheeran/rqab1veh/10/" rel="nofollow noreferrer"><strong>Fiddle 1</strong></a></p>
  
  <p>Now, I added another column to display the status value as text. Now, both "Status" column and "Action" column are utilizing the same data column - IsActive. After adding this column, the javascript function is not changing the button from "Retire" to "Activate".</p>
  
  <p><a href="https://jsfiddle.net/LijoCheeran/rqab1veh/11/" rel="nofollow noreferrer"><strong>Fiddle 2</strong></a></p>
  
  <p>What is the best way to fix this issue?</p>
  
  <p><strong>CODE</strong></p>
  
  <pre><code>$(document).ready(function () {
  
  function updateActiveStatus(rowid, isToActive) {
  
  alert('function');
  
                          // first change the cell in the visible part of grid
                          $("#list").jqGrid('setCell', rowid, 'firstname', 'A');
  
                          // now change the internal local data
                          $("#list").jqGrid('getLocalRow', rowid).firstname = 'A';
  
  
                          $("#list").jqGrid('setCell', rowid, 'IsActive', false);
                          $("#list").jqGrid('getLocalRow', rowid).IsActive = false;
  
  
  
              }
  
  
              var myData = [
  
                  { "id": "35", "firstname": null, "codeval": "G", "note": "xx7866", "amount": "23", "IsActive": true },
                  { "id": "73", "firstname": null, "codeval": "W", "note": "dd1047", "amount": "34", "IsActive": true },
                  { "id": "75", "firstname": "LORA", "codeval": "H", "note": "rr7323", "amount": "56", "IsActive": true },
                  { "id": "95", "firstname": "EST", "codeval": "M", "note": "gg574", "amount": "55", "IsActive": true }
                  ],
  
                  myGrid = $("#list");
  
              myGrid.jqGrid({
                  datatype:'local',
                  data: myData,
                  colNames: ['ID', 'FirstName', 'Code', 'Amount', 'Note', 'Action'],
                  colModel:[
                      {name:'id',width:70,align:'center',sorttype: 'int'},
                      {name:'firstname',width:80, align:'center'},
                      { name: 'codeval',  width: 70 },
                      {name:'amount',width:100, formatter:'number'},
                      {name:'note',index:'note',width:100,sortable:false},
                       {
                          name: 'IsActive',
                          width: 100,
                          formatter: function (cellvalue, options, rowObject)                                                 {
                              if (cellvalue == true) {
                                  return '&lt;div style="padding-left:5px;"&gt;&lt;button class="ui-button ui-widget ui-state-default app-custom-button-retire" &gt;' +
                                          '&lt;span title="" class="ui-button-icon-primary ui-icon ui-icon-scissors"&gt;&lt;/span&gt;Retire' +
                                          '&lt;/button&gt;&lt;/div&gt;';
                              }
                              else {
                                  return '&lt;div style="padding-left:5px;"&gt;&lt;button class="ui-button ui-widget ui-state-default app-custom-button-activate" &gt;' +
                                          '&lt;span title="" class="ui-button-icon-primary ui-icon ui-icon-check"&gt;&lt;/span&gt;Activate' +
                                          '&lt;/button&gt;&lt;/div&gt;';
                              }
                          }
                      }
                  ],
                  rowNum:10,
                  pager: '#pager',
                  gridview:true,
                  ignoreCase:true,
                  rownumbers:true,
                  viewrecords: true,
                  sortorder: 'desc',
                  height: '100%',
                  beforeSelectRow: function (rowid, e) {
                      var $self = $(this),
                          $td = $(e.target).closest("tr.jqgrow&gt;td"),
                          rowid = $td.parent().attr("id"),
                          //rowData = $self.jqGrid("getLocalRow", rowid),
                          rowData = $self.jqGrid("getRowData", rowid)
                      iCol = $td.length &gt; 0 ? $td[0].cellIndex : -1,
                      colModel = $self.jqGrid("getGridParam", "colModel");
  
                      celValue = $self.jqGrid('getCell', rowid, 'FirstName');
  
                      if (iCol &gt;= 0 &amp;&amp; colModel[iCol].name === "IsActive") {
  
                          if ($(e.target).hasClass("app-custom-button-retire")) {
                              updateActiveStatus(rowid,false);
                              return false;
                          }
  
                          if ($(e.target).hasClass("app-custom-button-activate")) {
  
                              updateActiveStatus(rowid, true);
                              return false;
                          }
                      }
  
  
                      //Avoid selection of row
                      return false;
                  }
              });
              myGrid.jqGrid('filterToolbar', { stringResult: true, searchOnEnter: false, defaultSearch: "cn" });
  
          });
  </code></pre>