kor TürkçeGitHub

Models and binding

Bind controls to UI5 models and choose when to supply an aggregation template.

Properties and normal aggregations

Set a model on the view. A property like value="{/draft/customer}" reads an absolute model path. In an aggregation template, {name} is relative to the entry. Below, core:Item is the template for each entry in /warehouses.

<k:SelectField xmlns:k="kor.ui" xmlns:core="sap.ui.core"
    label="Warehouse" selectedKey="{/draft/warehouse}"
    items="{path: '/warehouses', templateShareable: false}">
  <core:Item key="{id}" text="{name}"/>
</k:SelectField>

Row bindings

DataGrid and LookupField read contexts directly from rows. Supply the path and optional UI5 binding parameters. Set column paths relative to each row. TreeGrid needs a tree binding. For JSON data, give UI5 the child array names.

<k:TreeGrid xmlns:k="kor.ui" rows="{path: '/nodes', parameters: {arrayNames: ['children']}}">
  <k:columns><k:Column label="Cost center" path="name"/></k:columns>
</k:TreeGrid>

Filters and saved views

Use FilterBar to produce UI5 filters. Pass the filters parameter from change to grid.getBinding("rows").filter(filters). Variants uses its targets' getState and setState methods. Use storageKey for browser storage, or bind variants and save updates from change in the application.