David O.
David O.

Reputation: 97

UI and info_dialog Jqgrid

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

Upvotes: 3

Views: 2906

Answers (1)

Oleg
Oleg

Reputation: 221997

$.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);
    }
});

Upvotes: 2

Related Questions