Note that there are some explanatory texts on larger screens.

plurals
  1. POInline Edit on Enter using multiselect, multibox and scroll:1
    text
    copied!<p>How to start inline edit if Enter is pressed in jqGrid and multiselect: true option is also used? If multiselct is present, jqGrid bindKeys function does not have any effect.</p> <p>To verify this testcase below can be used (based on sample provided in Oleg comment).</p> <p>Steps to reproduce:</p> <ol> <li>Save code below to html file and open it in IE 9</li> <li>Click in grid and press enter</li> </ol> <p>Observed:</p> <ol> <li>Message box does not appear</li> <li>Also up and down arrow move whole grid</li> </ol> <p>Expected:</p> <ol> <li>Enter press should cause message box to appear</li> <li>up and down arrow should change current row in grid</li> </ol> <p>How to get expected behaviour ?</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt; &lt;head&gt; &lt;title&gt;http://stackoverflow.com/questions/5988767/highlight-error-cell-or-input-when-validation-fails-in-jqgrid&lt;/title&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;link rel="stylesheet" type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/themes/redmond/jquery-ui.css" /&gt; &lt;link rel="stylesheet" type="text/css" href="http://www.ok-soft-gmbh.com/jqGrid/jquery.jqGrid-4.0.0/css/ui.jqgrid.css" /&gt; &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript" src="http://www.ok-soft-gmbh.com/jqGrid/jquery.jqGrid-4.0.0/js/i18n/grid.locale-en.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $.jgrid.no_legacy_api = true; $.jgrid.useJSON = true; &lt;/script&gt; &lt;script type="text/javascript" src="http://www.ok-soft-gmbh.com/jqGrid/jquery.jqGrid-4.0.0/js/jquery.jqGrid.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(function () { var mydata = [ { id: "1", invdate: "2007-10-01", name: "test", note: "note", amount: "200.00", tax: "10.00", closed: true, ship_via: "TN", total: "210.00" }, { id: "2", invdate: "2007-10-02", name: "test2", note: "note2", amount: "300.00", tax: "20.00", closed: false, ship_via: "FE", total: "320.00" }, { id: "3", invdate: "2007-09-01", name: "test3", note: "note3", amount: "400.00", tax: "30.00", closed: false, ship_via: "FE", total: "430.00" }, { id: "4", invdate: "2007-10-04", name: "test4", note: "note4", amount: "200.00", tax: "10.00", closed: true, ship_via: "TN", total: "210.00" }, { id: "5", invdate: "2007-10-31", name: "test5", note: "note5", amount: "300.00", tax: "20.00", closed: false, ship_via: "FE", total: "320.00" }, { id: "12", invdate: "2007-09-10", name: "test12", note: "note12", amount: "500.00", tax: "30.00", closed: false, ship_via: "FE", total: "530.00" } ]; var grid = $("#grid"); grid.jqGrid({ datatype: 'local', data: mydata, colModel: [ { name: 'invdate', editable: true, width: 30 }, { name: 'name', editable: true, width: 271 } ], gridview: true, pager: '#pager', viewrecords: true, multikey: "ctrlKey", // added July 6, 2011 scroll:1, // added July 6, 2011 todo: data should passed from URL multiselect: true, multiboxonly: true, editurl: 'clientArray' }); $("#grid").jqGrid('bindKeys', { onEnter: function (rowid) { alert("You enter a row with id: " + rowid); } }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;table id="grid"&gt;&lt;/table&gt; &lt;div id="pager"&gt;&lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>UPDATE: added multiboxonly: true to testcase do demontrate previous row not unselected issue</p> <p><strong>Update</strong></p> <p>Added multikey: "ctrlKey" to testcase. In this case bindKeys proposed in Oleg answer stops working</p>
 

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