Page 1 of 1

[HowTo] JQHTMLEditor in JQDialog

PostPosted: 12 Apr 2013 10:24
by Alexander Bulei
JQHTMLEditor canonly be initialized when is visible!
If you try to initiate with hidden element in FireFox you will get this javascript error:

Code: Select all
Error: uncaught exception: [Exception...
"Component returned failure code: 0x80004005
(NS_ERROR_FAILURE) [nsIDOMNSHTMLDocument.execCommand]" 
nsresult: "0x80004005
(NS_ERROR_FAILURE)" 


and in other browsers will work incorrectly, some times with javascript error's, that error's come from javascript plugin.

So if you need to use the JQHTMLEditor in JQDialog, you must do:

  • Set
    Code: Select all
    JQHTMLEditorOptions.AutoPluginInit:= False;
  • Make initialization when JQHTMLEditor is visible, you can use JQDialogOptions.OnOpen

    • Code: Select all
      procedure TIWForm3.IWCGJQDialog1JQDialogOptionsOpen(Sender: TObject; AParams: TStringList);
      begin
        IWCGJQHTMLEditor1.PluginInitialization;
      end;


      or onCreate of form(frame)


    • Code: Select all
      IWCGJQDialog1.JQDialogOptions.OnOpen.Script:= 'function (event, ui){' + IWCGJQHTMLEditor1.PluginInitJS + '}';
  • Turn off JQDialogOptions animations (Show and Hide properties)

Note:
  • AutoPluginInit
  • PluginInitialization
  • PluginInitJS

Available from version V1.5.4.2010

Best Regards.