-1

I'm working with Delphi 10.3. On my form I create a tabulator object to display the data of my table. The fields "Datum" and "Menge" are related to the original table, and the field "Name" is related to the foreign table (bound with a FOREIGN KEY definition in my Firebird database).

procedure TForm1.WebFormCreate(Sender: TObject);
begin
// ...
  asm
  var MyTab = new Tabulator("#Id_MyTab",
    {
    data:MyData,
    columns:
      [
      {field:"DATUM", title:"Datum",  // ... },
      {field:"ID_ForeignTab.NAME", title:"Name",  // ... },
      {field:"MENGE", title:"Menge",  // ... },  
      // ...
      ],
    // ...
    });
  end;
// ...
end;

I've set a button to edit the selected row. When I click the button a new form is opened to enter the values for all columns. After this is done I send the new values to my server to update the record in my database. Now I want to display the new values on my form. I'm using the Tabulator.updateRow() function to store the column values of the edited row in my tabulator object.

procedure TForm1.wBtn_BearbClick(Sender: TObject);
begin
// ...
asm
MyTab.updateRow(Idx,{DATUM:"2024-07-01", ID_ForeignTab:ForeignKey, MENGE:1.0});    
end;
// ...
end;

With "normal" columns where I can pass the values directly it works. But one of the columns is defined as foreign key in my Firebird database and can be changed. If I pass the key value directly the column "Name" (relating to a field of the foreign table) is displayed empty after the function is called. Passing "ID_ForeignTab.Name:"Bob" failed.

Does anyone have on idea how to pass the value for the foreign key so that the values of the foreign table are displayed correctly?

0

Browse other questions tagged or ask your own question.