Disabling modal popup in jqgrid

I want to create a custom message without using a modal popup in jqgrid. Is there any way to disable it? Or is there a way to change the modal content?

+3
source share
5 answers

You can be more specific? If you need your own modal dialog, you can simply add an event handler (for example, to the "Edit" button) so that when you start it will open its own dialog box. You can use the jQuery UI dialog for this purpose and just open it for your own custom form.

Update After checking the source code, jqGrid info_dialogis a function that is used to display this particular dialog. There is a separate call to display the "Loading ..." popup. Alas, there is no easy way to disable it info_dialog. However, you can change the jqGrid source to accomplish what you need. You can:

  • Come back from immediately info_dialog- this can be extreme because it can tell you about other errors - or

  • Find and comment out the call displaying this particular ajax error. There is some trial error, but with 18 calls to this function you will not need much time to track. In fact, start by commenting on this instance, as it is called from errorthe ajax call function :

    info_dialog(a.jgrid.errors.errcap,e.status+" : "+e.statusText+"<br/>"+u,a.jgrid.edit.bClose);

, , , , jqGrid, .

+2

div.loadingui div.msgbox {...} - css . , css .

0

z- , ,

editoptions: { size: 20, maxlength: 10,

                            dataEvents: [
                          { type: 'keypress',
                              fn: function (e) {
                                  if (e.keyCode == 13) {
                                      **$("#info_dialog").css('z-index', '100000');**
                                  }
                              }
                          }
                       ]


                        } }

, , , ,

onCellSelect: function (rowid, iCol, aData) {
                    currentRow = rowid;
                    if (rowid && rowid !== lastsel) {
                        if (lastsel) jQuery('#ppGrid').jqGrid('restoreRow', lastsel);
                        $("#ppGrid").jqGrid('editRow', rowid, true, null, null, null, {}, reload,OnError);
                        lastsel = rowid;
                    }
                    else if (rowid && rowid === lastsel)
                    { $("#ppGrid").jqGrid('editRow', rowid, true, null, null, null, {}, reload,OnError); }


                }
0

Yes you can do it. you can make the false [ $("#info_dialog").visible(false);] property visible in the modal field, and you can call whatever your custom modal block is.

editrules: { custom: true, custom_func: validate_edit }


function validate_edit(posdata, colName) {
            var message = "";
            if (posdata != '' && $.isNumeric(posdata))
                return [true, ""];

            if (posdata == '')
                message = colName + " field is required"
            if (!$.isNumeric(posdata))
                message = posdata + " is not a number";

            alert(message);

            $("#info_dialog").visible(false);

            return [false, ""];
        }
0
source

Source: https://habr.com/ru/post/1729522/


All Articles