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,012
  • 2
  • 19
  • 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
  • 219,533
  • 32
  • 395
  • 775
  • @lucasdc: You can ["accept"](http://meta.stackexchange.com/a/5235/147495) the answer if the problem is solved. Additionally you can vote any helpful answers which you find on the stackoverflow. **Voting helps other readers to find helpful information on the stackoverflow because searching engine use voting as the most important criteria**. You have right to vote up to 30 questions or answers **per day** (see [here](http://meta.stackexchange.com/a/5213/147495)). It's more as enough in my experience. Till now you used the rite only twice. Do you find so few helpful information of stackoverflow? – Oleg Feb 03 '14 at 16:27
  • @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