Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If I understand you correct you want to enable/disable "Edit" or "Delete" buttons of the navigator based of the selected row. So that you will have <img src="https://i.stack.imgur.com/E3zuI.png" alt="enter image description here"></p> <p>if no rows is selected or the selected row is non-editable or the standard navigator toolbar <img src="https://i.stack.imgur.com/Ouwej.png" alt="enter image description here"></p> <p>if the row is editable.</p> <p>The criteria whether the column "editable" or "readonly" seems me wrong because it is criteria column on the column and not on the row, but you can implement easy your own custom criteria.</p> <p>The implementation could be </p> <pre><code>var myGrid = jQuery("#list"); myGrid.jqGrid({ /* definition of jqGrid */ beforeSelectRow: function(rowid) { var selRowId = $(this).getGridParam('selrow'), tr = $("#"+rowid); // you can use getCell or getRowData to examine the contain of // the selected row to decide whether the row is editable or not if (selRowId !== rowid &amp;&amp; !tr.hasClass('not-editable-row')) { // eneble the "Edit" button in the navigator $("#edit_" + this.id).removeClass('ui-state-disabled'); $("#del_" + this.id).removeClass('ui-state-disabled'); } else { // unselect previous selected row // disable the "Edit" and "Del" button in the navigator $("#edit_" + this.id).addClass('ui-state-disabled'); $("#del_" + this.id).addClass('ui-state-disabled'); } return true; // allow selection or unselection }, loadComplete: function() { // just one example how to mark some rows as non-editable is to add // some class like 'not-editable-row' which we test in beforeSelectRow $("tr.jqgrow:even",this).addClass('not-editable-row'); } }).jqGrid('navGrid','#pager'); // disable "Edit" and "Delete" button at the beginning $("#edit_" + myGrid[0].id).addClass('ui-state-disabled'); $("#del_" + myGrid[0].id).addClass('ui-state-disabled'); </code></pre> <p>To enable/disable the "Edit" and "Del" buttons we add/remove the 'ui-state-disabled' class on the buttons of the navigator toolbar. In the code above I mark all rows with even numbers as "non-editable". In your case you can use any other criteria which has more sense.</p> <p>You can see the demo live <a href="http://www.ok-soft-gmbh.com/jqGrid/EdableDisableEditDelNavigatorButtons.htm" rel="noreferrer">here</a>.</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