Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>It's interesting question. I suppose that it's a bug in Google Chrome: it calculate the height of <code>&lt;td&gt;</code> in wrong way. To reduce the problem I suggest to reset <code>vertical-align</code> to <code>middle</code> at the beginning of row editing. It will include additional <code>style="vertical-align:middle"</code> attribute of <code>&lt;td&gt;</code>. At the end of editing one can remove the attribute.</p> <p>One can see the results on <a href="http://jsfiddle.net/3mrKD/6/" rel="nofollow">the modified demo</a>. The demo still increase the height of the row to 1px at the beginning of editing, but I think that after playing with other CSS attributes one can eliminate the effect. The code used in the demo is below</p> <pre><code>var lastSelected, removeVerticalAlignBaseline = function (rowid) { var tr = $(this).jqGrid("getInd", rowid, true), $tds = $(tr).find("&gt;td:has(&gt;input)"); $(tr).find("&gt;td:has(&gt;input)").each(function () { this.style.verticalAlign = "middle"; }); }, resetVerticalAlignBaseline = function (rowid) { var tr = $(this).jqGrid("getInd", rowid, true), $tds = $(tr).find("&gt;td"); $(tr).find("&gt;td:has(&gt;input)").each(function () { this.style.verticalAlign = ""; // remove the style // now the style from CSS will be used }); }, editOptions = { keys: true, oneditfunc: removeVerticalAlignBaseline, aftersavefunc: resetVerticalAlignBaseline, afterrestorefunc: resetVerticalAlignBaseline, }; $("#grid").jqGrid({ datatype: "local", data: [{ id: 1, name: "Alice" }, { id: 2, name: "Bob" }], colModel: [ { name: 'id' }, { name: 'name', editable: true } ], onSelectRow: function(id) { if (id &amp;&amp; id !== lastSelected) { $(this).jqGrid('restoreRow', lastSelected, editOptions); $(this).jqGrid('editRow', id, editOptions); lastSelected = id; } }, height: "auto" }); </code></pre>
    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. 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.
    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