CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

JQDynaNode Expand-property not works?

by wieczy123 » 04 Apr 2014 10:49

Hi,

Expand-property in a TIWCGJQDynaTreeNode does not work. It's always false. What can I do?

Thank you.

Best regards

Frank.
wieczy123
 
Posts: 19
Joined: 06 May 2013 10:20

by Alexander Bulei » 04 Apr 2014 10:57

Hi wieczy123,

Please check the documentation:

http://www.cgdevtools.com/docs/_html/IWCGJQDynaTree.TIWCGJQDynaTreeNode.Expand.htm

TIWCGJQDynaTreeNode.Expand - Initial expanded status.

To check the state of node, you need recent version of cgdevtools:

Code: Select all
2.0.0.3489

JQDynaTree
- Added: new methods ExecNodeCommand and "jsNodeCommand"


Documentation:

delphi code
{$IFDEF NODEF}{$REGION 'CGDevTools - Documentation'}{$ENDIF}
/// <summary>
/// Method to execute the command.
/// <note type="note">
/// Only commands:
/// <list type="bullet">
/// <item>
/// dtnActivate
/// </item>
/// <item>
/// dtnDeactivate
/// </item>
/// <item>
/// dtnExpand
/// </item>
/// <item>
/// dtnFocus
/// </item>
/// <item>
/// dtnMakeVisible
/// </item>
/// <item>
/// dtnSelect
/// </item>
/// <item>
/// dtnToggleExpand
/// </item>
/// <item>
/// dtnToggleSelect
/// </item>
/// </list>
/// can be called directly on event (e.g: OnClick).
/// </note>
/// <note type="note">
/// The commands that are not included in the previous note, can only
/// be used in BrowserParams.
/// </note>
/// </summary>
{$IFDEF NODEF}{$ENDREGION}{$ENDIF}
procedure ExecNodeCommand(ACommand: TIWCGJQDynaTreeNodeCommands; const AParams: string = '');
{$IFDEF NODEF}{$REGION 'CGDevTools - Documentation'}{$ENDIF}
/// <summary>
/// Method return javascript code for command.
/// </summary>
{$IFDEF NODEF}{$ENDREGION}{$ENDIF}
function jsNodeCommand(ACommand: TIWCGJQDynaTreeNodeCommands; const AParams: string = ''): string;


since you have this version (or above), you should use the jsNodeCommand in BrowserParams:

delphi code
with IWCGJQButton1.JQButtonOptions.OnClick.BrowserParams.Add do
begin
ServerName:= 'isextanded';
BrowserScript:= IWCGJQDynaTree1.Nodes.Items[1].jsNodeCommand(dtnIsExpanded);
end;


And OnClick event get the param:

delphi code
procedure TIWForm5.IWCGJQButton1JQButtonOptionsClick(Sender: TObject; AParams: TStringList);
begin
WebApplication.ShowMessage(AParams.Values['isextanded']);
end;


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 wieczy123 » 10 Apr 2014 13:21

Thanks :-)

...but it works only on "main-nodes" on "child-nodes" a "VariantTypeCastError" appear. See this c++ code:

TIWCGJQDynaTreeNode *newitem;
TIWCGJQDynaTreeNode *subitem;
String bs;

newitem = IWCGJQDynaTree1->Nodes->Add();
bs = newitem->jsNodeCommand(dtnIsExpanded); // ok.
newitem = IWCGJQDynaTree1->Nodes->Add();
bs = newitem->jsNodeCommand(dtnIsExpanded); // ok.
newitem = IWCGJQDynaTree1->Nodes->Add();
bs = newitem->jsNodeCommand(dtnIsExpanded); // ok.

subitem = newitem->Children->Add();
bs = subitem->jsNodeCommand(dtnIsExpanded); // fail: VariantTypeCastError

What can i do?

Thank you

Frank.
wieczy123
 
Posts: 19
Joined: 06 May 2013 10:20

by Alexander Bulei » 10 Apr 2014 13:58

Hi wieczy123,

Thanks, will fix right now.

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 Alexander Bulei » 10 Apr 2014 14:05

Fixed in V2.0.0.3516:

Code: Select all
JQDynaTree
- Fixed: Invalid typecast on children nodes (owner)


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


Return to JQTreeView

cron

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.