Skip to content

igxGrid Collapsible Column Groups

Desislava Dincheva edited this page Nov 11, 2019 · 8 revisions

TOC

Revision history

Version User Date Notes
0.1 Stefan Ivanov Feb 21, 2019 Spec and design initial creation
1.0 Zdravko Kolev Nov 04, 2019 Overview and API update, Stories and ARIA
1.1 Zdravko Kolev Nov 06, 2019 Final changes to ARIA and API

Overview

Collapsible multi-column headers make it possible to collapse all nested headers under the current one and layout the body cells of the underlying columns according to a template provided by the developer. A column group usually consists of two or more columns. When a column group is collapsed, a subset of the columns will be shown to the end-user. This subset can be one or more of the previously shown columns or an entirely new set of columns. Each collapsed/expanded column can be bound to the data source of the grid, or it may be unbound, thus calculated.

Objectives

User Stories

There are several use cases in which a user will need collapsible column groups.

As an end user, I want to

  • be able to expand and collapse grouped columns through their multicolumn headers to show more relevant or hide less critical information in the grid

  • be able to mark one or more columns per group as visible on collapse action, having the overall column count greatly reduced.

  • be able to define a header template when a group column is collapsed as a summary of the combined headers.

  • be able to define a cell template when a group column is collapsed as a summary of the combined cells.

  • be able to change the expand/collapse indicator

User Interface

Expanded State

Expanded state

Collapsing Address multi-column header

Collapsing the MCH for the first column group

Developer Stories

As a developer, I want to

  • Be able to set a group column as collapsible
  • Be able to set the initial state of a group column to expand or not.
  • Have collapsible capabilities only if there is one child column with visibleWhenCollapse set to true. Note: if all child columns are set to visibleWhenCollapse false, the collapsible indicator won't be shown.
  • Be able to define a template for the layout that is used when a multi-column header is collapsed
    • This template should make it possible to combine different types of data
    • This template may additionally modify the data e.g. 12 Jan 2019 -> 1/12/19
    • This template may create a template for a single cell or define a layout of cells
  • Have the grid header reduce its height automatically as headers are collapsed when the necessary height to render the headers decreases.

Collapsing all MCH in the grid

API

Inputs

Name Description Type Default value
collapsible Used to identify that certain Grouped column is collapsible boolean false
expand Used to set whether the group is expanded or collapsed initially. Applied only if the collapsible property is set to true boolean true
visibleWhenCollapse used to identify whether the column would be visible on collapsed state of the grouped column boolean undefined/true/false

Events

Name Description Cancelable Event arguments
collapsibleChange This event is fired when collapsible state for a column group is changed No Boolean
expandChange This event is fired when a group is expanded/collapsed No Boolean
visibleWhenCollapseChange This event is fired when visibleWhenCollapse state for the column is changed No Boolean

ARIA support

WAI-ARIA Support In 2014 the W3C finalized their WAI-ARIA specification which defined how to design Web content and Web applications to be more accessible to users with disabilities. The Grid has been designed so that it follows these guidelines.

The list below provides details about what changes have been made to the Grid Columns to support WAI-ARIA. Please note that no special settings are needed to leverage these changes, as they are all enabled by default.

  • tabindex attribute allows access to the elements through the use of TAB and SHIFT + TAB keys. Note: The tabindex attribute should be rendered on every additional navigational element in the header elements.
  • aria-label thee igxGrid header elements should carry aria-label attributes with the column header text, in order for the header text to be read instead of the title attribute value when a title attribute is present
  • columnheader each igxGrid header element should be decorated with columnheader role.

Assumptions and Limitations

  • At least one column should be shown when you expand/collapse a group - When you define group rules, a check is made whether you would have at least one column shown when the group is expanded or collapsed

  • Group options’ hidden takes precedence over column hidden - If you declared your column to be hidden using the property hidden and you have a group defined where the same column should be shown, the column will be shown.

[In progress] Test Scenarios

Automation

Manual

Clone this wiki locally