0

I have a grid with a custom button that opens another grid. On this second grid, when an error occurs, the dialog error is showing up behind it. How can I set zIndex? Here is relevant part of my code:

$.ajax({
            ... 
            complete: function(xmldata, stat){
                if(stat == "success") {
                    $('#dialog').dialog('close');
                }
                else {
                    e = "Erro customizado.";
                    $.jgrid.info_dialog($.jgrid.errors.errcap,typeof e==="string"?e:e.message,$.jgrid.edit.bClose);
                }

           }
        });
lucasdc
  • 1,032
  • 2
  • 20
  • 42

1 Answers1

1

$.jgrid.info_dialog method support the 4-th parameter which can be used to specify some options. The source code provide the list of default values of the options. So you can use zIndex option to set zIndex higher as the default 1000 value:

$.jgrid.info_dialog(
    $.jgrid.errors.errcap,
    typeof e === "string" ? e : e.message,
    $.jgrid.edit.bClose,
    { zIndex: 1500 }
);

If you have to use an old version of jqGrid of, if you have to increase zIndex of info_dialog which will be indirectly called, you can use "subclassing" trick which I described in the answer.

Community
  • 1
  • 1
Oleg
  • 220,925
  • 34
  • 403
  • 798
  • @lucasdc: No problem! I want that you just understand that the main goal of voting is providing tips for searching engine of the stackoverflow (and so tips for google too). By usage of your voting right your helps other users of stackoverflow to find the question or the asnwer which you find helpful for you. So please use the right in the future. – Oleg Feb 03 '14 at 18:05