CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

DynaTree: problem with check

by Corwin » 06 May 2015 15:13

Hi

I have a strange problem with the check.
As in the demo I load values but by a db
delphi code
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
.....
    LoadNodes(True);
   JQDynaTree.JQDynaTreeOptions.Checkbox:= True;
   JQDynaTree.ExpandAll;
.....
procedure TIWComponentForm.LoadNodes(const AFixed: boolean);
begin
  // Read value from db
  .....
// main nodes
                TreeNode:= JQDynaTree.Nodes.Add;
                descr := libutil.escapeChar(dm.OraQueryCeCoDett.FieldByName('NPADRE').Value);
                TreeNode.Title:= descr;
                TreeNode.ToolTip:= intToStr(dm.OraQueryCeCoDett.FieldByName('cFiglio').Value) + ' - ' +    dm.OraQueryCeCoDett.FieldByName('nPadre').Value;
                TreeNode.IsFolder:= True;
   ....
// child nodes
               LoadChildren(TreeNode,NumNodes, dm.OraQueryCeCoDett.FieldByName('NPADRE').Value, dm.OraQueryCeCoDett.FieldByName('cfiglio').Value, dm.OraQueryCeCoDett.FieldByName('cPadre').Value, fold ,False, AFixed);
.......
 
end;
 
procedure TIWComponentForm.LoadChildren(AParentNode: TIWCGJQDynaTreeNode; const NumNodes: Integer; descr: String; cdc: Integer; cpadre:integer; fold:integerconst AStopLoading: boolean; const AFixed: Boolean);
var
  TreeNode: TIWCGJQDynaTreeNode;
  I, ANumNodes: Integer;
begin
  for I := 1 to NumNodes do
  begin
    TreeNode:= AParentNode.Children.Add;
    if (fold > 0) then
      TreeNode.IsFolder:= True;
    TreeNode.Title:= descr;
    TreeNode.ToolTip:= intToStr(cdc) + ' - ' + descr;
    descr := libutil.escapeChar(descr);
    if (fold > 0) then  // fold is nr child eventually
      LoadChildrenChild(TreeNode,fold,True,AFixed);
  end;
 
end;


Dynatree work perfectly. Check works on all items but
JQDynaTree.SelectedNodes.Count is set only for the nodes and not the children

delphi code
1
2
3
4
5
6
7
8
9
10
11
procedure TJQDynaTreeFrame.IWCGJQButton3JQButtonOptionsClick(Sender: TObject; AParams: TStringList);
var
  I: Integer;
  s: string;
begin
  for I := 0 to JQDynaTree.SelectedNodes.Count-1 do
  begin
    s:= s + JQDynaTree.SelectedNodes[i] + '</br>';
  end;
 
end;


What's the problem? :?:

Regards
Corwin
 
Posts: 114
Joined: 27 Apr 2015 10:01

by Corwin » 07 May 2015 12:33

The question is:

even if I read all of the nodes and their children, which property tells me if the item is checked?
Corwin
 
Posts: 114
Joined: 27 Apr 2015 10:01

by Corwin » 11 May 2015 08:18

any idea? :?:
Corwin
 
Posts: 114
Joined: 27 Apr 2015 10:01

by Alexander Bulei » 11 May 2015 11:34

Hi Corwin,

I don't see any issue with SelectedNodes.
Please check the attached demo.

Best Regards.
You do not have the required permissions to view the files attached to this post.
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: 3637
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal

by Corwin » 11 May 2015 12:20

Hi

I have not explained well.

in attachment you can see my example
dynaExample.png


I have to be able to select one or more child, but, in the example, IWCGJQDynaTree1.SelectedNodes.Count = 0; if instead Admin department is checked, IWCGJQDynaTree1.SelectedNodes.Count = 1 ...

another question is:
SOC AFFARI GENERAL is the DynaTree property TITLE, but the key relative in that DynaTree property is set?

Regards
You do not have the required permissions to view the files attached to this post.
Corwin
 
Posts: 114
Joined: 27 Apr 2015 10:01

by Alexander Bulei » 11 May 2015 14:01

Hi Corwin,

I don't know what is the problem in your side, but you can check our demo:

http://www.cgdevtools.com/demo/JQueryDemoV3_IW14_ISAPI.dll?frame=jqdynatree

Works as expected.
Maybe you can send us the simple testcase? T.I.A

SOC AFFARI GENERAL is the DynaTree property TITLE, but the key relative in that DynaTree property is set?


UniqueName property is auto generated, but you can set to your own (must be unique!).

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: 3637
Joined: 15 May 2012 08:52
Location: Mealhada, Portugal


Return to JQDynaTree

cron

Who is online

Users browsing this forum: No registered users and 0 guests

Contact Us.