Row Detail
Last updated
Last updated
index
Troubleshooting
/
A Row Detail allows you to open a detail panel which can contain extra and/or more detailed information about a row. For example, we have a user list but we want to display detailed information about this user (his full address, account info, last purchasers, ...) but we don't want to display this in the user grid (for performance and real estate reasons), so a Row Detail is perfect for this.
View
Component
Row Detail is an addon (commonly known as a plugin and are opt-in addon), because this is not built-in SlickGrid and instead are opt-in, we need to get the instance of that addon object. Once we have the instance, we can use getOptions
and setOptions
to get/set any of the addon options, adding rowDetail
with intellisense should give you this info.
Examples
Dynamically change the Detail View Row Count (how many grid rows do we want to use for the row detail panel)
Same as previous paragraph, after we get the SlickGrid addon instance, we can call any of the addon methods, adding rowDetail
with intellisense should give you this info.
Examples
Dynamically close all Row Detail Panels
Dynamically close a single Row Detail by it's grid index This requires a bit more work, you can call the method collapseDetailView(item)
but it requires to pass the row item object (data context) and it feasible but it's just more work as can be seen below.
Most of the time we would get data asynchronously, during that time we can show a loading spinner to the user via the preloadComponent
grid option.
View
Component
Same concept as the preload, we pass an Angular Component to the viewComponent
that will be used to render our Row Detail.
Grid Component
Row Detail View (rowdetail-view.component.html
)
Row Detail Component rowdetail-view.component.ts
)
App Module
Also make sure that it's part of your App Module entryComponents
array since this will be a dynamically created component.
The Row Detail provides you access to the following references (SlickGrid, DataView, Parent Component and the Addon (3rd party plugin)), however please note that all of these references are available from the start except the Parent Component instance, for that one you need to reference it inside your Row Detail Grid Options like so:
Then in our Child Component, we can do some action on the Grid, the DataView or even call a method form the Parent Component (the showFlashMessage
in our demo), with that in mind, here is the code of the Child Component
View
Component
The reason is because the Row Selection (checkbox) plugin is a special column and Angular-Slickgrid is adding an extra column dynamically for the Row Selection checkbox and that is not reflected in your local copy of columnDefinitions
. To address this issue, you need to get the Angular-Slickgrid internal copy of all columns (including the extra columns), you can get it via getAllColumnDefinitions()
from the Grid Service and then you can use to that array and that will work.