Skip to content

Grid binding to data source with nested properties

Radoslav Karaivanov edited this page Jul 15, 2020 · 3 revisions

Grid binding to data source with nested properties

Contents

Revision History

Version User Date Notes
0.1 Radoslav Karaivanov June 25, 2020 Initial Draft
0.2 Radoslav Karaivanov July 6, 2020 Update ARIA spec and user stories
0.3 Radoslav Karaivanov July 13, 2020 Add exporters feature to user stories
0.4 Radoslav Karaivanov July 15, 2020 Add limitation section

1. Overview

Objectives

Expose a way for users to render and manipulate complex/nested data which is bound to the grid.

2. User Stories

  • be able to easily bind to a complex/nested data source of the grid in order to render that data in the grid cells.

    Example:

    <igx-grid ...>
        <igx-column field="foo.bar.baz"></igx-column>
    </igx-grid>
  • be able to use the default grid data operation features (sorting, filtering, groupby) to operate on the bound data out of the box.

  • CRUD operations should support working with bound nested data out of the box.

  • copy/paste functionality should work with columns bound to complex data.

  • summaries functionality should work with columns bound to complex data.

  • Excel/CSV exporting functionality should work with columns bound to complex data.

3. Implementation

The grid will implement a value mapper function that will be used in the cell template as a pure pipe to resolve the path of the target property. The same function is also used in both the filtering/sorting value resolvers for the comparisons.

The CRUD operations will be using the reverse of the value mapper function to build the 'diffed' object which will be merged back into the original record.

Initially, exposing the inner value mapper function may not be needed. The idea is the user to render their data as fast as possible without writing any additional boilerplate code or configuration.

If needed the filtering/sorting operations can be customized/extended by overwriting their respective default strategies.

4. Limitations

The grids do not support nested binding for primary key | child key | foreign key.

5. API

No new methods/properties are exposed.

6. ARIA Support

The feature follows the current ARIA implementation for the cells in the grid: that is a combination of the grid's id with the column field. Currently we are replacing the . character in the column field path but that may not be necessary as per the updated HTML spec

Clone this wiki locally