views:

703

answers:

3

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

+2  A: 

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.

Justin Ethier
jqgrid uses a default popup for alerts, that's what I want to remove
Ygam
You mean the one that says "loading", for example?
Justin Ethier
yes. and the one that appears whenever a server request failed (I successfully captured the ajaxError event and had my custom message set up, but the modal dialog also appears, which says Error: 500 and the corresponding message
Ygam
A: 

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

Aseem Gautam
A: 

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

Boris Barroso
Nice grid, but are you suggesting he start from scratch just because he is having trouble displaying a custom message box?
Justin Ethier