Page 1 of 1

Displaying JQDialog in JS

PostPosted: 30 Nov 2016 10:32
by mait
Is there a way to both display and hide a TIWCGJQDialog using javascript in the browser rather than using an async call back to the server? (Clicking the "X" button at the top right closes the dialog so there must be some way to do it.)

Thanks, Peter

Re: Displaying JQDialog in JS

PostPosted: 30 Nov 2016 10:56
by Alexander Bulei
Hello,

If you understand javascript and properties of Event, you can use the client side javascript.

The javascript code is generated from functions with js perfix.

E.g:

delphi code
IWCGJQButton1.JQButtonOptions.OnClick.Script:= Format('function(){ %s; }',[IWCGJQDialog1.JQDialogOptions.JsClose]);


Best Regards.

Re: Displaying JQDialog in JS

PostPosted: 30 Nov 2016 23:01
by mait
Works well thanks. Moving a lot of processing from the server to the browser has been a steep learning curve but the more I learn the more I like the CGJQ components. Really appreciate your help.

For those coming across this post at some later stage, the javascript calls are:

javascript code
$("#MYDIALOG").dialog("open");
$("#MYDIALOG").dialog("close");


if you wish to notify the server that the visibility status has changed (the next time the form is submitted) then the following line should do the trick.

javascript code
AddChangedControl("MYDIALOG_VISIBLE");


Thanks, Peter