pandell / SlickGrid

A lightning fast JavaScript grid/spreadsheet
http://wiki.github.com/mleibman/SlickGrid
MIT License
1 stars 0 forks source link

Predefined group values based on parent grouping #9

Closed timphillips closed 8 years ago

timphillips commented 8 years ago

Background

SlickGrid grouping supports predefined group values. These are groups that should always be included in the grid, even when there is no grid data that falls into the group. These groups will show up as “empty” groups in the grid:

image

Problem

Currently SlickGrid does not support defining a set of predefined group values based on the value of a parent grouping. The values defined in the predefinedValues group option are always applied to the groupings:

image

In JV, we have a grid that requires predefined group values based on the value of a parent grouping. For example, showing "Duration" group values of 1, 2, 3 when "Finish" is 2009-01-01 and "Duration" group values of 4, 5, 6 when "Finish" is 2009-02-02.

Solution

Add support for a group option to specify predefined values based on a parent group. This option (tentatively called predefinedValuesByParentGroup) allows you to specify a set of predefined group values based on the value of a parent grouping:

group = {
    "formatter": ...,
    "getter": ...,
    "predefinedValuesByParentGroup": {
          "parentValue1": [...],
          "parentValue2": [...]
    }
}

image

timphillips commented 8 years ago

Moved to https://github.com/pandell/web-pli/pull/248.