謝謝你的錯誤報告!我剛剛發佈the bug fix。它改進的內部savePositionOnHide
功能的用於保存的先前位置的代碼從
savePositionOnHide = function (propName, frmgr, h) {
var $w = h.w, $form = $(frmgr), $gbox = this.closest(".ui-jqgrid"), top, left;
if ($.contains($gbox[0], $w[0])) {
// we use below .style.height and .style.width to save correctly "auto" and "100%" values
// the "px" suffix will be saved too, but it's not a problem
top = getCssStyleOrFloat($w, "top");
left = getCssStyleOrFloat($w, "left");
} else {
top = $w.offset().top -
($gbox.offsetParent().offset().top +
$gbox.offset().top +
$gbox.position().top +
parseFloat($gbox.css("border-top-width") || 0));
left = $w.offset().left -
($gbox.offsetParent().offset().left +
$gbox.offset().left +
$gbox.position().left +
parseFloat($gbox.css("border-left-width") || 0));
}
this.data(propName, {
top: top, //parseFloat($w.css("top")),
left: left, //parseFloat($w.css("left")),
width: getCssStyleOrFloat($w, "width"), //$(h.w).width(),
height: getCssStyleOrFloat($w, "height"), //$(h.w).height(),
dataheight: getCssStyleOrFloat($form, "height") || "auto",
datawidth: getCssStyleOrFloat($form, "width") || "auto"
});
$w.remove();
if (h.o) { h.o.remove(); }
}
到
savePositionOnHide = function (propName, frmgr, h) {
var $w = h.w, $form = $(frmgr), $gbox = this.closest(".ui-jqgrid"),
getTopOrLeftRelativeToGbox = function (topOrLeft) {
return $w.offset()[topOrLeft] -
($gbox.offsetParent().offset()[topOrLeft] +
$gbox.offset()[topOrLeft] +
$gbox.position()[topOrLeft] +
parseFloat($gbox.css("border-" + topOrLeft + "-width") || 0));
};
this.data(propName, {
top: getTopOrLeftRelativeToGbox("top"),
left: getTopOrLeftRelativeToGbox("left"),
width: getCssStyleOrFloat($w, "width"),
height: getCssStyleOrFloat($w, "height"),
dataheight: getCssStyleOrFloat($form, "height") || "auto",
datawidth: getCssStyleOrFloat($form, "width") || "auto"
});
$w.remove();
if (h.o) { h.o.remove(); }
},
我希望問題已在表格編輯的輸入參數的所有組合的情況下。至少演示https://jsfiddle.net/OlegKi/tzp91wnf/現在可以正常工作。
Добрыйдень!你能否加入演示,以便重現問題?我無法在[演示](http://www.ok-soft-gmbh.com/jqGrid/ViewFormOnDoubleClick1.htm)上重現和更改'top'和'left'的位置。 – Oleg
япокамогусвойкоднаписать: –
我創建演示https://jsfiddle.net/OlegKi/tzp91wnf/其再現了這個問題。我會檢查它並稍後將錯誤修復與我的答案一起發佈。 – Oleg