Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

UI and info_dialog Jqgrid

Tags:

jqgrid

How do I set the z-index for info_dialog, when using UI dialog ?

like image 206
David O. Avatar asked Dec 18 '25 03:12

David O.


1 Answers

$.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);
    }
});
like image 69
Oleg Avatar answered Dec 23 '25 08:12

Oleg



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!