How do I set the z-index for info_dialog, when using UI dialog ?
UI and info_dialog Jqgrid
$.jgrid.info_dialog uses internally $.jgrid.createModal which uses $.jgrid.jqModal
(see the line) which introduced since not so long time (see my suggestion here). So you can do something like
$.jgrid.jqModal = $.extend($.jgrid.jqModal || {}, {
zIndex: 1234
});
because of another parameter of navGrid
you have to add additionally
$.extend($.jgrid.nav, {
alertzIndex: 1234
});
to make $.jgrid.jqModal.zIndex
setting working.
UPDATED: In any way you can use "subclassing" of $.jgrid.info_dialog
(like in the answer for example). The corresponding code could be like the following:
var oldInfoDialog = $.jgrid.info_dialog;
$.extend($.jgrid,{
info_dialog: function (caption, content, c_b, modalopt) {
if (modalopt && (modalopt.zIndex === null || modalopt.zIndex === undefined ||
(typeof modalopt.zIndex === "number" && modalopt.zIndex < 1234))) {
modalopt.zIndex = 1234;
}
return oldInfoDialog.call (this, caption, content, c_b, modalopt);
}
});
I have: {name:'procent',index:'procent', width:70,align:'center',editable:true,editrules:{required:true}},and When field " procent " is empty, info_dialog appear, but z-index is 1000, and behind UI Dialog –
Revanche
@DavidO.: I suppose indirectly that you use inline editing or cell editing and not form editing. If would be better to append your question with the code example (just click on "edit" link under the text of the question). By the way, the value 1000 come from the line which I referenced. –
Dulles
@DavidO.: In any way you can solve the problem by the usage of "subclassing": see UPDATED part of my answer. –
Dulles
Thank you. It's ok. But an error occurs when you press the close.TypeError: i.hideModal is not a function –
Revanche
@DavidO.: I can't see any errors. I inserted the code in one old demo and all seems to work. See the demo. –
Dulles
In your demo , inline editing on double-click, leave the name field blank, and save. appears info_dialog with error, then press the close button –
Revanche
@DavidO.: Ohh, yes. To fix the problem one should use
.call
with this
: oldInfoDialog.call (this, caption, content, c_b, modalopt);
instead of oldInfoDialog (caption, content, c_b, modalopt);
. I fixed the text of the answer and the demo. –
Dulles © 2022 - 2024 — McMap. All rights reserved.
zIndex
. There are many options how the problem could be fixed. One can modify one line of jqGrid code (here or here) or overwriteinfo_dialog
method and call the original one withzIndex
set. – Dulles