mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-10-09 13:18:29 +08:00
This reverts commit 6bdb3622bd.
Reason for revert: Interaction tests started failing on mac.
https://ci.chromium.org/ui/p/devtools-frontend/builders/ci/Stand-alone%20Mac/2514/overview
Original change's description:
> Add header context menu to data grid
>
> This CL adds a default header context menu to the data grid that lists visible
> and sortable columns much like the legacy data grid.
>
> Bug: 1150793
> Change-Id: I84a8a9cc511d6be9fee1f89ba41a6e8649df54ec
> Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2600723
> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
> Reviewed-by: Paul Lewis <aerotwist@chromium.org>
TBR=aerotwist@chromium.org,jacktfranklin@chromium.org
Change-Id: Ic8ef16044716d922d3a37b6a8fb32e13a75dee72
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1150793
Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2601962
Reviewed-by: Jan Scheffler <janscheffler@chromium.org>
Commit-Queue: Jan Scheffler <janscheffler@chromium.org>
54 lines
1.8 KiB
HTML
54 lines
1.8 KiB
HTML
<!--
|
|
Copyright 2020 The Chromium Authors. All rights reserved.
|
|
Use of this source code is governed by a BSD-style license that can be
|
|
found in the LICENSE file.
|
|
-->
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<meta name="viewport" content="width=device-width" />
|
|
<title>Basic Data grid controller example</title>
|
|
<style>
|
|
#container {
|
|
width: 80%;
|
|
border: 1px solid black;
|
|
padding: 20px;
|
|
}
|
|
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div id="container">
|
|
</div>
|
|
|
|
<script type="module">
|
|
import * as ComponentHelpers from '../../component_helpers/component_helpers.js';
|
|
import * as Components from '../../ui/components/components.js';
|
|
|
|
ComponentHelpers.ComponentServerSetup.setup().then(() => renderComponent())
|
|
|
|
const renderComponent = () => {
|
|
const component = new Components.DataGridController.DataGridController();
|
|
|
|
component.data = {
|
|
columns: [
|
|
{ id: 'key', title: 'Key', sortable: true, widthWeighting: 1, visible: true, hideable: false},
|
|
{ id: 'value', title: 'Value', sortable: false, widthWeighting: 1, visible: true, hideable: false },
|
|
],
|
|
rows: [
|
|
// Each key is the ID of a column, and the value is the value for that column
|
|
{cells: [{ columnId: 'key', value: 'Bravo', title: 'Bravo'}, { columnId: 'value', value: 'Letter B'}] },
|
|
{cells: [{ columnId: 'key', value: 'Alpha', title: 'Alpha'}, { columnId: 'value', value: 'Letter A'}] },
|
|
{cells: [{ columnId: 'key', value: 'Charlie', title: 'Charlie'}, { columnId: 'value', value: 'Letter C'}] },
|
|
]
|
|
}
|
|
|
|
document.getElementById('container').appendChild(component)
|
|
}
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|