You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Right-to-left (RTL) support. We recommend using Firefox as Chrome has a [bug](https://issues.chromium.org/issues/40653832) with frozen columns.
47
+
- Right-to-left (RTL) support.
46
48
47
49
## Links
48
50
@@ -51,15 +53,27 @@
51
53
-[Changelog](CHANGELOG.md)
52
54
-[Contributing](CONTRIBUTING.md)
53
55
54
-
## Install
56
+
## Installation
57
+
58
+
to install `react-data-grid`, use npm or yarn:
55
59
56
60
```sh
57
61
npm install react-data-grid
62
+
# or
63
+
yarn add react-data-grid
64
+
```
65
+
66
+
Additionally, import the default styles in your application:
67
+
68
+
```jsx
69
+
import'react-data-grid/lib/styles.css';
58
70
```
59
71
60
72
`react-data-grid` is published as ECMAScript modules for evergreen browsers, bundlers, and server-side rendering.
61
73
62
-
## Quick start
74
+
## Getting started
75
+
76
+
Here is a basic example of how to use `react-data-grid` in your React application:
63
77
64
78
```jsx
65
79
import'react-data-grid/lib/styles.css';
@@ -81,7 +95,7 @@ function App() {
81
95
}
82
96
```
83
97
84
-
## API
98
+
## API Reference
85
99
86
100
### Components
87
101
@@ -93,7 +107,7 @@ function App() {
93
107
94
108
See [`Column`](#column).
95
109
96
-
An array describing the grid's columns.
110
+
An array of column definitions. Each column should have a key and name.
97
111
98
112
:warning: Passing a new `columns` array will trigger a re-render for the whole grid, avoid changing it as much as possible for optimal performance.
99
113
@@ -103,15 +117,15 @@ An array of rows, the rows data can be of any type.
103
117
104
118
###### `topSummaryRows?: Maybe<readonly SR[]>`
105
119
106
-
An optional array of summary rows, usually used to display total values for example. `topSummaryRows` are pinned at the top of the rows view and the vertical scroll bar will not scroll these rows.
120
+
Rows pinned at the top of the grid for summary purposes.
107
121
108
122
###### `bottomSummaryRows?: Maybe<readonly SR[]>`
109
123
110
-
An optional array of summary rows, usually used to display total values for example. `bottomSummaryRows` are pinned at the bottom of the rows view and the vertical scroll bar will not scroll these rows.
124
+
Rows pinned at the bottom of the grid for summary purposes.
111
125
112
126
###### `rowKeyGetter?: Maybe<(row: R) => K>`
113
127
114
-
A function returning a unique key/identifier per row. `rowKeyGetter` is required for row selection to work.
128
+
Function to return a unique key/identifier for each row. `rowKeyGetter` is required for row selection to work.
The first parameter is a new rows array with both the updated rows and the other untouched rows.
139
154
The second parameter is an object with an `indexes` array highlighting which rows have changed by their index, and the `column` where the change happened.
140
155
@@ -153,31 +168,31 @@ function MyGrid() {
153
168
154
169
**Default:**`35` pixels
155
170
156
-
Either a number defining the height of row in pixels, or a function returning dynamic row heights.
171
+
Height of each row in pixels. A function can be used to set different row heights.
157
172
158
173
###### `headerRowHeight?: Maybe<number>`
159
174
160
175
**Default:**`35` pixels
161
176
162
-
A number defining the height of the header row.
177
+
Height of the header row in pixels.
163
178
164
179
###### `summaryRowHeight?: Maybe<number>`
165
180
166
181
**Default:**`35` pixels
167
182
168
-
A number defining the height of summary rows.
183
+
Height of each summary row in pixels.
169
184
170
185
###### `selectedRows?: Maybe<ReadonlySet<K>>`
171
186
172
187
A set of selected row keys. `rowKeyGetter` is required for row selection to work.
Triggered when a cell is doubleclicked. The default behavior is to open the editor if the cell is editable. Call `preventGridDefault` to prevent the default behavior
341
+
Callback triggered when a cell is double-clicked. The default behavior is to open the editor if the cell is editable. Call `preventGridDefault` to prevent the default behavior
327
342
328
343
```tsx
329
344
function onCellDoubleClick(args:CellClickArgs<R, SR>, event:CellMouseEvent) {
0 commit comments