CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

IWCGCreateMessageDialog Auto...

by etwoss » 02 Oct 2014 14:03

HI

using this code:
Code: Select all
procedure TIWForm8.IWCGJQButton1JQButtonOptionsClick(Sender: TObject;
  AParams: TStringList);

var
  Dlg : TIWCGJQMsgDialog;
  LMessage: String;
begin
  LMessage := 'Are you sure you want to cancel request for product ''xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ss ss'' ?';

  Dlg := IWCGCreateMessageDialog('', mtConfirmation, [mbYes,mbNo],
    procedure(Dialog: TIWCGJQMsgDialog; AResult: TModalResult)
    begin
      if AResult = mrYes then
      begin
      end;

  end);

  Dlg.Message := LMessage;
  Dlg.JQDialogOptions.AutoHeight := True;
  Dlg.JQDialogOptions.AutoWidth := True;
  Dlg.JQDialogOptions.Closable := False;
  Dlg.JQDialogOptions.Resizable := False;

  Dlg.JQDialogOptions.OnClose.OnEvent := DialogClose;
  Dlg.AjaxReRender();


I expected that the dialogs height and width are big enough to Show the long message, but its not , its still standard size

Am i missing some property?

Eric
etwoss
 
Posts: 1205
Joined: 06 Feb 2014 08:58

by etwoss » 02 Oct 2014 14:09

Hi

Hmmm... when i set


Dlg.JQDialogOptions.Height := 175;
Dlg.JQDialogOptions.Width := 750;

The message it still in 4 lines.

It works fine if i set

Dlg.Height := 175;
Dlg.Width := 750;

Eric
etwoss
 
Posts: 1205
Joined: 06 Feb 2014 08:58

by Jorge Sousa » 02 Oct 2014 14:37

Hi

If you investigate how jqueryui Dialog.AutoWidth and Dialog.AutoHeight, work, it automatically calculates the height,

so you shouldnt render any particular width or height, ie, StyleRenderOptions.RenderSize should be False.
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by Alexander Bulei » 02 Oct 2014 15:14

Hi Eric,

We have fixed the AutoWidth property in JQDialog:

v2.3.0.58:

IWCGJQDialog
- Fixed: AutoWidth property


Note

But there is an important thing, you MUST set the message AFTER the definition of dialog (options).




Here you have the your changed code:

delphi code
procedure TIWForm8.IWCGJQButton1JQButtonOptionsClick(Sender: TObject;
AParams: TStringList);

var
Dlg : TIWCGJQMsgDialog;
LMessage: String;
begin
LMessage := 'Are you sure you want to cancel request for product ''xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ss ss'' ?';

Dlg := IWCGCreateMessageDialog('', mtConfirmation, [mbYes,mbNo],
procedure(Dialog: TIWCGJQMsgDialog; AResult: TModalResult)
begin
if AResult = mrYes then
begin
end;

end);


// Dlg.JQDialogOptions.Closable := False; // <- check documentation
Dlg.JQDialogOptions.ShowCloseIcon:= False;
Dlg.JQDialogOptions.Resizable := False;
Dlg.JQDialogOptions.AutoHeight := True;
Dlg.JQDialogOptions.AutoWidth := True;
Dlg.Message := LMessage;

Dlg.JQDialogOptions.OnClose.OnEvent := DialogClose;
Dlg.AjaxReRender();


Best Regards.
Group: Developers | Support Team

  • info [at] cgdevtools.com - General information
  • sales [at] cgdevtools.com - Sales department
  • support [at] cgdevtools.com - Product and Technical Support
User avatar
Alexander Bulei
Site Admin
 
Posts: 3635
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by etwoss » 03 Oct 2014 07:38

Thanks!
etwoss
 
Posts: 1205
Joined: 06 Feb 2014 08:58


Return to IWCGJQMessageDlg

Who is online

Users browsing this forum: No registered users and 2 guests

Contact Us.