|
2 | 2 | * Data grid is a simple widget designed to list the filtered records, providing
|
3 | 3 | * a simple way to define how the items are displayed.
|
4 | 4 | *
|
5 |
| - * Note: Unlike other charts, the data grid chart (and data table) use the group attribute as a keying function |
| 5 | + * Note: Unlike other charts, the data grid chart (and data table) use the {@link dc.dataGrid#group group} attribute as a keying function |
6 | 6 | * for {@link https://github.com/mbostock/d3/wiki/Arrays#-nest nesting} the data together in groups.
|
7 | 7 | * Do not pass in a crossfilter group as this will not work.
|
8 | 8 | *
|
@@ -103,6 +103,23 @@ dc.dataGrid = function (parent, chartGroup) {
|
103 | 103 | return _chart._doRender();
|
104 | 104 | };
|
105 | 105 |
|
| 106 | + /** |
| 107 | + * Get or set the group function for the data grid. The group function takes a data row and |
| 108 | + * returns the key to specify to {@link https://github.com/d3/d3-3.x-api-reference/blob/master/Arrays.md#d3_nest d3.nest} |
| 109 | + * to split rows into groups. |
| 110 | + * |
| 111 | + * Do not pass in a crossfilter group as this will not work. |
| 112 | + * @method group |
| 113 | + * @memberof dc.dataGrid |
| 114 | + * @instance |
| 115 | + * @example |
| 116 | + * // group rows by the value of their field |
| 117 | + * chart |
| 118 | + * .group(function(d) { return d.field; }) |
| 119 | + * @param {Function} groupFunction Function taking a row of data and returning the nest key. |
| 120 | + * @returns {Function|dc.dataTable} |
| 121 | + */ |
| 122 | + |
106 | 123 | /**
|
107 | 124 | * Get or set the index of the beginning slice which determines which entries get displayed by the widget.
|
108 | 125 | * Useful when implementing pagination.
|
@@ -219,7 +236,7 @@ dc.dataGrid = function (parent, chartGroup) {
|
219 | 236 | };
|
220 | 237 |
|
221 | 238 | /**
|
222 |
| - * Get or set sort order function. |
| 239 | + * Get or set sort the order function. |
223 | 240 | * @method order
|
224 | 241 | * @memberof dc.dataGrid
|
225 | 242 | * @instance
|
|
0 commit comments