Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It seem to me that you have already a global JavaScript function like <code>MyCheckOut</code> and call it inside of '???' area. If you add to this function an additional parameter like <code>rowId</code> then you can simply so overwrite the contain of you <code>&lt;input&gt;</code> button of the 'action', that it will point to new <code>MyCheckIn</code> function and have corresponding text in the <code>value</code> attribute. Your code will looks like following:</p> <pre><code>MyCheckOut = function (gridId,rowId) { // do Check Out // ... // replace "Check Out" button to "Check In" var checkIn = "&lt;input style='height:22px;width:75px;' type='button' " + "value='Check In' " + "onclick=\"MyCheckIn(jQuery('" + gridId + "')," + rowId + "); \" /&gt;"; jQuery(gridId).jqGrid('setRowData', rowId, { action: checkIn }); }; MyCheckIn = function (grid,rowId) { // do Check In // .. // replace "Check In" button to "Check Out" like in MyCheckOut }; jQuery("#east-grid").jqGrid({ // ... colNames: ['Id', ... , 'Action' ], colModel: [ { name: 'Id', sortable: false, width: 1, hidden: true}, // ... { name: 'action', index: 'action', width: 75, sortable: false } ], // ... gridComplete: function() { var grid = jQuery("#east-grid"); var ids = grid.jqGrid('getDataIDs'); for (var i = 0; i &lt; ids.length; i++) { var rowId = ids[i]; var checkOut = "&lt;input style='height:22px;width:75px;' " + "type='button' value='Check Out' " + "onclick=\"MyCheckOut('#east-grid'," + rowId + ");\" /&gt;"; grid.jqGrid('setRowData', rowId, { action: checkOut }); } }, // ... }); </code></pre> <p>If you have as a <code>rowId</code>not an integer, then you should place <code>'</code> from the both side from <code>rowId</code>.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload