Skip to content

Commit

Permalink
test Grid
Browse files Browse the repository at this point in the history
  • Loading branch information
IgorNovozhilov committed Jul 23, 2020
1 parent 04c5c7e commit 24af227
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 6 deletions.
14 changes: 9 additions & 5 deletions static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,23 @@
<meta http-equiv='X-UA-Compatible' content='IE=edge'>
<title>Test tui.editor</title>
<meta name='viewport' content='width=device-width, initial-scale=1'>

<link rel="stylesheet" href="https://uicdn.toast.com/editor/latest/toastui-editor.css">
<link rel="stylesheet" href="https://uicdn.toast.com/editor/latest/toastui-editor-viewer.css">

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@toast-ui/editor@2/dist/toastui-editor.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/codemirror@5/lib/codemirror.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/tui-grid@4/dist/tui-grid.css">
<link rel="stylesheet" href="/main.css">
</head>

<body>

<div id="grid"></div>
<div id="editor"></div>

</body>

<script src="https://uicdn.toast.com/editor/latest/toastui-editor-all.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/codemirror@5/lib/codemirror.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@toast-ui/editor@2/dist/toastui-editor.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@toast-ui/editor@2/dist/i18n/ru-ru.js"></script>
<script src="https://cdn.jsdelivr.net/npm/tui-grid@4/dist/tui-grid.js"></script>
<script type="module" src="/main.js"></script>

</html>
4 changes: 4 additions & 0 deletions static/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
html, body {
height: 100%;
margin: 0;
}
28 changes: 27 additions & 1 deletion static/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,30 @@
const { Editor } = window.toastui
const { Grid } = window.tui
const grid = new Grid({
el: document.getElementById('grid'),
data: [{
name: 'name',
title: 'title'
}],
scrollX: false,
scrollY: false,
columns: [
{
header: 'Page name',
name: 'name',
editor: 'text'
},
{
header: 'Page title',
name: 'title',
editor: 'text'
}
]
})
const editor = new Editor({
el: document.querySelector('#editor')
el: document.querySelector('#editor'),
height: 'auto',
previewStyle: 'vertical',
initialEditType: 'wysiwyg',
language: 'ru'
})

0 comments on commit 24af227

Please sign in to comment.