Data Loading in the Planner

I have the following structure - using FNC Planner with a WebApp.

I think I have done the right thing so far.

  • I am loading data from an Entity
  • I can see that the data is getting loaded in the Browser/Network tab
  • I am not seeing anything in the calendar yet, so my properties settings are incorrect.

I next want to convince myself that the data has been loaded into the planner. Is there an event on any of the components, or a property that I can use to see that this is happening.

    src_: TWebDataSource;
    xds_: TXDataWebDataSet;
    db_: TTMSFNCPlannerDatabaseAdapter;
    div_Buttons: TWebHTMLDiv;
    pln_: TTMSFNCPlanner;
    xds_Ref: TLargeintField;
    xds_Subject: TStringField;
    xds_Resources_Summary: TStringField;
    xds_Start_Time: TDateTimeField;
    xds_End_Time: TDateTimeField;

    procedure db_ItemsLoaded(Sender: TObject);
    procedure src_DataChange(Sender: TObject; Field: TField);
    procedure src_StateChange(Sender: TObject);
    procedure src_UpdateData(Sender: TObject);
    procedure WebFormCreate (Sender: TObject);
    procedure xds_AfterOpen(DataSet: TDataSet);

procedure Tfrm_Planner.WebFormCreate (Sender : TObject);
begin
  pln_.Top  := 8;
  pln_.Left := 170;

  FButtons  := TPln_Buttons.Create (div_Buttons);
  FButtons.OnClick := Button_Click;
end;

procedure Tfrm_Planner.Initialise;
begin
  TConsole.Log ('Assigned', pln_.Adapter <> nil);
  pln_.BeginUpdate;
  Initialise_Timeline;
  pln_.EndUpdate;
  Initialise_Data_Binding;
  Activate;
end;

procedure Tfrm_Planner.Activate;
begin
  pln_.Enabled := True;
  TConsole.Log ('PLN','Loading Items');
  db_.LoadItems;
  pln_.Visible := True;
end;

procedure Tfrm_Planner.Initialise_Data_Binding;
begin
  TConsole.Log ('PLN','Data Binding');
  with db_
  do begin
     Item.DataSource := src_;
     Item.DBKey      := fld_Ref;
     Item.Title      := fld_Subject;
     Item.Text       := fld_Summary;
     Item.StartTime  := fld_Start_Time;
     Item.EndTime    := fld_End_Time;
  end;
  xds_.Active := True;
  db_.Active  := True;
  xds_.Load;
  Dump ('Data Binding');
end;

procedure Tfrm_Planner.Initialise_Timeline;
begin
  TConsole.Log ('PLN','Timeline');
  with pln_
  do begin
     Mode                     := pmMultiDay;
     ModeSettings.StartTime   := Now;
     Positions.Count          := 7;
     Timeline.DisplayUnit     := 15;
     Timeline.DisplayUnitType := pduMinute;
     Timeline.DisplayStart    := 0;
     Timeline.DisplayEnd      := 143;
     Timeline.ViewStart       := Now;
  end;
end;


I am at the stage where the items are getting loaded.

I need horizontal bars for most views. I am unclear what to do with Positions and Resources. Which one do I assign to say Aircraft names?

Hi,

Did you checkout the demo in the distribution?
Demo.zip (272.4 KB)

I did, I have been copying it. But there are many properties to fiddle with