Hi Kevin,
You can customize the overlay with css.
To better management, i suggest you to use the css classes, and apply to overlay on "OnOpen" event of dialog.
Here you have the simple example:
css code
.my-error-overlay{
background: red;
}
.my-success-overlay{
background: green;
}
As you know, the event has two features:
- Property "Script" - execute the javascript on browser/client side
- OnEvent - call the function on server.
So, If your dialog does nothing on "OnOpen" event, as this is done in the client browser, you can use the script property to prevent the unnecessary call to the server:
delphi code
IWCGJQDialog1.JQDialogOptions.OnOpen.Script:= 'function (event, ui){ $(".ui-widget-overlay").addClass("my-error-overlay"); }'; // my-success-overlay
If you have already some code in this event, you have to do as my colleague said :
delphi code
var
js: string;
begin
js:= '$(".ui-widget-overlay").addClass("my-error-overlay");';
CGAddJavaScriptToAjaxResponse(js);
end;
Best Regards.