CGDevTools Forum

Welcome to the Official CGDevTools Support Community Forums.

question about LoadTree method

by Luckman » 06 Aug 2014 04:32

I am missing something basis here because I modified CGJQueryTreeGrid for my purpose and it doesn't behave as expected - I am using a collection of items and it walks the properties - what I am missing is how that drop down character gets there thats lets you expand it. My data gets added but there is no indicator there is more data even though there is.

Thanks! In the code below, I have a task item with a unique id that it is adding to the grid and I expect to use that as the attribute id. Again, I am clearly missing something.

function TIWFrameTreeGrid.LoadTree(AInstance: TObject; APropInfo: PPropInfo; var AData): Boolean;
var
ATreeRec: TLoadTreeRec absolute AData;
v: Variant;
Id: string;
Obj: TObject;
x : integer;
Task : TTaskItem;
begin
Result:= True;

Id:= ATreeRec.Parent;
if Id <> '' then
Id := Id + '.';
Id:= Id + APropInfo^.Name;

if Assigned(APropInfo^.PropType) and (APropInfo^.PropType^.Kind = tkClass) then
begin
Obj:= GetObjectProp(AInstance,APropInfo^.Name);
if (Obj is TPersistent) and not (TPersistentAcc(Obj).GetOwner = AInstance) then
begin
for x := 0 to TCollection(Obj).Count - 1 do
begin
Task := TTaskItem(TCollection(Obj).Items[x]);
with ATreeRec.XMLNode.AddChild('row') do
begin
Attributes['id']:= Task.ID;
AddChild('cell').Text:= INtToStr(Task.ID);
//APropInfo^.Name;
AddChild('cell').Text:= '';
AddChild('cell').NodeValue:= ATreeRec.Level; // level
AddChild('cell').NodeValue:= ATreeRec.Parent; // Parent
AddChild('cell').NodeValue:= False; // IsLeaf
AddChild('cell').NodeValue:= False; // expanded
// AddChild('cell').Text:= Task.Name;
// AddChild('cell').Text:= Task.Group;
// AddChild('cell').Text:= Task.Owner; // Value
// AddChild('cell').Text:= DateToStr(Task.DateDue); // Value
// AddChild('cell').Text:= Task.Status;
// AddChild('cell').Text:= Task.Messages; // Value


end;
end;
end;
end
Luckman

Posts: 4
Joined: 03 Aug 2014 11:59
Luckman
 
Posts: 80
Joined: 03 Aug 2014 19:59

by Luckman » 06 Aug 2014 15:12

Apparently this was a dumb question. My apologies for not understanding an undocumented API.
Luckman
 
Posts: 80
Joined: 03 Aug 2014 19:59

by Jorge Sousa » 06 Aug 2014 15:37

Hello

It's not a dumb question, and we will answer as soon as we can.

What do you mean by undocumented API?
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by Luckman » 06 Aug 2014 15:47

What I mean is I am having trouble finding the information that tells how this works in theory. Some of this functionality isn't that intuitive even though it works, nor is the sample code commented. So it assumes I know why its doing what its doing and when it comes to the browser stuff, I don't have that information. I'm sure it's nothing for your regular web developers but I come from the windows side; and I am missing information and not sure where to get it.
Luckman
 
Posts: 80
Joined: 03 Aug 2014 19:59

by Jorge Sousa » 06 Aug 2014 16:03

Hi

In this post of yours

http://www.cgdevtools.com/cgforum/viewtopic.php?f=5&t=1669&p=8458#p8458

We already pointed out the documentation available: More info here: http://www.trirand.com/jqgridwiki/doku. ... i:treegrid

For adjacency mode, I'm sorry but there is no more available, thats why we purposed you the nested mode, demonstrated in demo DBTreeGrid.
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by Luckman » 06 Aug 2014 16:07

OK sorry, I don't recall being directed to the DBTReeGrid. Thanks for your help, I'll check it out.
Luckman
 
Posts: 80
Joined: 03 Aug 2014 19:59

by Jorge Sousa » 07 Aug 2014 16:08

post closed, after chat support
Best Regards
CGDevTools Develop / Support Team
Home Page: http://www.cgdevtools.com
Jorge Sousa
 
Posts: 4261
Joined: 17 May 2012 09:58

by fateh78 » 13 Apr 2017 00:16

Dear Luckyman
can you send us a copy of your CGJQueryTreeGrid (i think it is TreeGrid loaded from dataset) and save our time to reinventing the wheel
your kind cooperation will be highly appreciated
best regards
fateh78
 
Posts: 85
Joined: 16 Mar 2017 21:45


Return to JQGrid

Who is online

Users browsing this forum: No registered users and 1 guest

Contact Us.