Customer Name | Company Name | Address | Country |
---|---|---|---|
Thomas Hardy | Around the Horn | 120 Hanover Sq. | UK |
Christina Berglund | Berglunds snabbköp | Berguvsvägen 8 | Sweden |
Frédérique Citeaux | Blondesddsl père et fils | 24, place Kléber | France |
Yang Wang | Chop-suey Chinese | Hauptstr. 29 | Switzerland |
Roland Mendel | Ernst Handel | Kirchgasse 6 | Austria |
Order ID | Freight | Ship Name | Ship Country | Ship Address |
---|---|---|---|---|
10265 | $55.28 | Blondel père et fils | France | 24, place Kléber |
10297 | $5.74 | Blondel père et fils | France | 24, place Kléber |
10360 | $131.70 | Blondel père et fils | France | 24, place Kléber |
10436 | $156.66 | Blondel père et fils | France | 24, place Kléber |
10449 | $53.30 | Blondel père et fils | France | 24, place Kléber |
Master-Detail Grid is a use case scenario, in which the details of a Master Grid record, is viewed in a separate Grid(Detail Grid) by clicking the particular row.
The steps to achieve this scenario is as follows,
rowSelected
event. dataSource
property.The above demo is implemented as follows.
DetailComponent(ejs-griddetail)
to show details of selected row from Master Grid.DetailComponent
has an Input
property key
, based on which the data will be filtered and set to the Detail Grid. Here the CustomerID value is used as key value.MasterComponent
which has Master Grid component with rowSelected
event bound to it.MasterComponent
uses DetailComponent
and it updates key
property when a row is selected in the Master Grid.Use selectedRowIndex
to select a row at the initial rendering.
Injecting Module
Grid component features are segregated into individual feature-wise modules. To implement this use case, the selection feature need to be enabled and also we need to inject SelectionService
into the @NgModule.providers
section.