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
{{ message }}
This repository was archived by the owner on Jan 6, 2025. It is now read-only.
Description of changes
Updates data grid docs to better clarify that the rowsData method does not work when using the React toolkit components and provides an example of how to create data grids when using React.
Copy file name to clipboardExpand all lines: src/data-grid/README.md
+44-1Lines changed: 44 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,7 @@ For example, if you're using a data grid to display real-time earthquake data, a
53
53
54
54
### Basic Data Grid
55
55
56
-
The recommended basic usage of the `vscode-data-grid` is to use JavaScript (or TypeScript) to programmatically populate the rows and cells of the grid using the `rowsData` property as shown below.
56
+
The recommended basic usage of the `vscode-data-grid` is to use JavaScript (or TypeScript) to programmatically populate the rows and cells of the grid using the `rowsData` property as shown below._Notable exception: The `rowsData` property doesn't work at this time when using the React toolkit components –– see below for an alternative approach._
57
57
58
58
With that said, a data grid can still be created with HTML only (also shown below).
This is the recommended way of creating data grids when using React.
83
+
82
84
Note: When defining data grids using only HTML, a header row must be manually defined (as demonstrated below).
83
85
84
86
Additionally, in previous versions of the toolkit (less than or equal to `v0.9.1`), an attribute of `generate-header="none"` needs to be applied to the `vscode-data-grid` component. This ensures that an extra empty header row is not automatically generated.
@@ -114,6 +116,47 @@ Starting in `v0.9.2`, however, this behavior has changed so a header row is not
114
116
</vscode-data-grid>
115
117
```
116
118
119
+
Here's a further example of how you might use React's templating syntax to programmatically generate data rows.
The `generate-header` attribute is applied to the `<vscode-data-grid>` component and can be used to automatically generate a header row when data is passed to the `rowsData` property in JavaScript.
0 commit comments