Skip to main content

Visual Linking

Visual Linking is the process of establishing a parent child relationship (either 1:1 or 1:many) between a parent table and a child table in view ports. When rows are selected in the viewport of the parent table, the server side filters results in the child based on statically defined relationships in the module definition.

Example:

SimulationModule.scala

      .addTable(
TableDef(
name = "childOrders",
keyField = "id",
Columns.fromNames("parentOrderId".int(), "id".string(), "idAsInt".int(), "ric".string(), "price".double(),
"quantity".int(), "side".string(), "account".string(), "exchange".string(), "ccy".string(),
"strategy".string(), "volLimit".double(), "filledQty".int(), "openQty".int(), "averagePrice".double(),
"status".string(), "lastUpdate".long()),
//this is the important line...
VisualLinks(
Link("parentOrderId", "parentOrders", "idAsInt")
),
indices = Indices(
Index("parentOrderId"),
Index("quantity"),
Index("exchange"),
Index("ccy"),
),
joinFields = "id", "ric"
),
(table, vs) => new ChildOrdersProvider(table, ordersModel)
)

If you look at this code from our SimulationModule, you can see we've declared a potential link from this table ChildOrders to parentOrders. The structure of the declaration is: Link(fieldInChildTable, parentTable, fieldInParentTable)

Anytime you declare these links, our UI will allow you to select the Visual Linking usimng a right click on the grid.