1 | # Using the Column `dataIndex` Property
|
2 |
|
3 | The `dataIndex` property on a column definition states how the column should grab data from the array of data objects passed to grid. This data can be a one level object where data is accessed by a single key, or it can be a nested object where data must be retrieved deeper than the first level.
|
4 |
|
5 | Example:
|
6 |
|
7 | ```javascript
|
8 | const data = {
|
9 | topLevel: 1,
|
10 | outer: {
|
11 | middle: {
|
12 | inner: 'rowValue'
|
13 | }
|
14 | }
|
15 | };
|
16 |
|
17 | const columns = [
|
18 | {
|
19 | name: 'Nested Value',
|
20 | dataIndex: ['outer', 'middle', 'inner']
|
21 | },
|
22 | {
|
23 | name: 'Top Level Value',
|
24 | dataIndex: 'topLevel'
|
25 | }
|
26 | ]
|
27 | ```
|