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