mirror of
https://github.com/react/react-native-devtools-frontend.git
synced 2026-09-30 17:27:22 +08:00
They snuck in mistakenly and break the examples. The import was unused and left over. TBR=aerotwist@chromium.org Change-Id: I48e49e24134f70146d441e6d83686ad6f3a51213 Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2562714 Reviewed-by: Jack Franklin <jacktfranklin@chromium.org> Commit-Queue: Jack Franklin <jacktfranklin@chromium.org>
58 lines
1.6 KiB
HTML
58 lines
1.6 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>Empty data grid</title>
|
|
<style>
|
|
#container {
|
|
width: 80%;
|
|
border: 1px solid black;
|
|
padding: 20px;
|
|
height: 300px;
|
|
}
|
|
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div id="container">
|
|
</div>
|
|
|
|
<ul id="events"></ul>
|
|
|
|
<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.DataGrid.DataGrid();
|
|
|
|
component.data = {
|
|
columns: [
|
|
{ id: 'key', title: 'Key', widthWeighting: 1, visible: true, hideable: false },
|
|
{ id: 'value', title: 'Value', widthWeighting: 1, visible: true, hideable: false },
|
|
],
|
|
rows: [
|
|
]
|
|
}
|
|
|
|
document.getElementById('container').appendChild(component)
|
|
component.addEventListener('cellFocus', event => {
|
|
const li = document.createElement('li');
|
|
li.innerHTML = `<pre><code>cellFocus: ${JSON.stringify(event.data)}</code></pre>`;
|
|
document.getElementById('events').appendChild(li)
|
|
})
|
|
}
|
|
|
|
</script>
|
|
</body>
|
|
</html>
|