Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If I understand correct your problem you can use <code>afterSaveCell</code> callback or some other which better for your requirements (see <a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki%3acell_editing#event_calling_stack" rel="nofollow">here</a>). You can test which column is modified and call <code>editCell</code> explicitly to suggest to edit depended cell. Probably you can use additionally custom validation rule (see <a href="http://www.trirand.com/jqgridwiki/doku.php?id=wiki%3acommon_rules#custom_checking_example" rel="nofollow">here</a>) to be sure that the user really modify dependent cell to the correct value.</p> <p><strong>UPDATED</strong>: <a href="http://www.ok-soft-gmbh.com/jqGrid/DependentCellEditng.htm" rel="nofollow">The demo</a> shows how you can call <code>editCell</code> inside of <code>afterSaveCell</code> callback to implement the behavior which you need. The most important part of the code of the demo you will find below:</p> <pre><code>var carCompanyEditingMode = false; $("#list").jqGrid({ ... afterSaveCell: function (rowid, cellname, value, iRow, iCol) { var $this = $(this), editedColName = this.p.colModel[iCol].name; if (editedColName === "carCompany") { setTimeout(function () { $this.jqGrid("editCell", iRow, iCol + 1, true); }, 50); carCompanyEditingMode = true; return; } if (carCompanyEditingMode &amp;&amp; editedColName === "model") { setTimeout(function () { $this.jqGrid("editCell", iRow, iCol + 1, true); }, 50); return; } if (carCompanyEditingMode &amp;&amp; editedColName === "year") { carCompanyEditingMode = false; } }, beforeSelectRow: function () { // don't allow editing of another row if // the carCompanyEditingMode is true return !carCompanyEditingMode; }, afterRestoreCell: function (rowid, value, iRow, iCol) { var $this = $(this); if (carCompanyEditingMode) { // continue editing of the same cell setTimeout(function () { $this.jqGrid("editCell", iRow, iCol, true); }, 50); } } }); </code></pre>
 

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