开发者

disabling modal popup in jqgrid

I want to create a custom message without using the modal popup in jqgrid. Is there a way to disable it? Or is t开发者_高级运维here a way to change the contents of the modal?


Can you be more specific? If you want your own modal dialog, you could just add an event handler (on an Edit button, for example) that when fired will open your own custom dialog. You can use the jQuery UI dialog for this purpose, and just have it open to your own custom form.

Update After inspecting the jqGrid source code, info_dialog is the function that is used to display this particular dialog. There is a separate call to display the "Loading..." popup. Offhand there does not seem to be a simple way to disable info_dialog. However, you could modify the jqGrid source to accomplish what you need. You could either:

  • Return immediately from info_dialog - which may be extreme because it could report other errors you need - or,

  • Find and comment out the call that is displaying this particular ajax error. There is some trial-and-error involved, but with only 18 calls to this function it will not take you long to track down. In fact, start by commenting out this instance, since it is called from the error function of an ajax call:

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

Obviously such a modification is a last resort, but once it works you might consider rolling a patch for the jqGrid team to disable the alert.


Search for div.loadingui div.msgbox { ... } somewhere in css files. I think editing this css class will get the job done.


i have changed the z-index of modal popup on runtime once you can access to it you can do any customization

editoptions: { size: 20, maxlength: 10,

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


                        } }

Also, if you can do it on another place if you have server response such as error

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


                }


Yes you can do it. you can make visible property to false [$("#info_dialog").visible(false);] of the modal box, and you can call what ever your custom modal box.

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, ""];
        }


I know this is out of the topic, but have you tried SlickGrid https://github.com/mleibman/SlickGrid/wiki/examples

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜