Row Detail

index

Demo

Demo Page / Demo ViewModel

Description

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 these are extra details that we don't want to display this in the user grid (for performance and real estate reasons)... so a Row Detail is perfect for that use case.

NOTE Please note that because of the complexity behind Row Detail, the following features might not mix well and possibly cause UI problems with Row Detail (use at your risk):

  • Pagination

  • Tree Data

  • RowSpan

NOTE 2 Also please note that because SlickGrid is using its built-in Virtual Scroll feature by default (for perf reasons), this will call render and re-render multiple times and that happens whenever the Row Detail gets out of the grid viewport. For this reason, you should avoid using dynamic elements (i.e. form inputs) because whenever a re-render kicks in, it will reset and re-render these elements as if nothing happened. So you should consider using Row Detail mainly for showing static data (hence where its name comes from "Row Detail" to show more detailed info) and even though it works with dynamic elements, you have to know its limitation.

Usage

Component

Changing Addon Options Dynamically

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)

Calling Addon Methods Dynamically

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.

Row Detail - Preload Component (loading spinner)

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. We could use this simple Preload Component example as shown below

Preload Component

Row Detail - ViewModel

Same concept as the preload, we pass an HTML template to render our Row Detail.

Row Detail Component

The best is to see the Example 21 code.

Demo Page / Demo ViewModel

Grid Definition

Last updated