Page 1 of 1

DynaTree: problem with check

PostPosted: 06 May 2015 15:13
by Corwin
Hi

I have a strange problem with the check.
As in the demo I load values but by a db
delphi code
.....
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:integer; const 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
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

Re: DynaTree: problem with check

PostPosted: 07 May 2015 12:33
by Corwin
The question is:

even if I read all of the nodes and their children, which property tells me if the item is checked?

Re: DynaTree: problem with check

PostPosted: 11 May 2015 08:18
by Corwin
any idea? :?:

Re: DynaTree: problem with check

PostPosted: 11 May 2015 11:34
by Alexander Bulei
Hi Corwin,

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

Best Regards.

Re: DynaTree: problem with check

PostPosted: 11 May 2015 12:20
by Corwin
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

Re: DynaTree: problem with check

PostPosted: 11 May 2015 14:01
by Alexander Bulei
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.