tui-grid
Version:
TOAST UI Grid : Powerful data grid control supported by TOAST UI
98 lines (95 loc) • 3 kB
HTML
<html lang="ko">
<head>
<meta charset="utf-8">
<title>3. Complex columns</title>
<link rel="stylesheet" type="text/css" href="./css/tui-example-style.css" />
<link rel="stylesheet" type="text/css" href="../dist/tui-grid.css" />
</head>
<body>
<div class="description">
You can see the tutorial <a href="https://github.com/nhnent/tui.grid/blob/master/docs/complex-columns.md" target="_blank">here</a>.
</div>
<div class="code-html contents">
<div id="grid"></div>
</div>
</body>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.0/jquery.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/underscore.js/1.8.3/underscore.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/backbone.js/1.3.3/backbone.js"></script>
<script type="text/javascript" src="https://uicdn.toast.com/tui.code-snippet/v1.5.0/tui-code-snippet.js"></script>
<script type="text/javascript" src="../dist/tui-grid.js"></script>
<script type="text/javascript" src="./data/basic-dummy.js"></script>
<script type="text/javascript" class="code-js">
var grid = new tui.Grid({
el: $('#grid'),
scrollX: false,
scrollY: false,
header: {
height: 160,
complexColumns: [
{
title: 'Basic',
name: 'mergeColumn1',
childNames: ['name', 'artist']
},
{
title: 'Extra',
name: 'mergeColumn2',
childNames: ['type', 'release', 'genre']
},
{
title: 'Detail',
name: 'mergeColumn3',
childNames: ['mergeColumn1', 'mergeColumn2']
},
{
title: 'Count',
name: 'mergeColumn4',
childNames: ['downloadCount', 'listenCount']
},
{
title: 'Album Info',
name: 'mergeColumn5',
childNames: ['price', 'mergeColumn3', 'mergeColumn4']
}
]
},
columns: [
{
title: 'Name',
name: 'name'
},
{
title: 'Artist',
name: 'artist'
},
{
title: 'Type',
name: 'type'
},
{
title: 'Release',
name: 'release'
},
{
title: 'Genre',
name: 'genre'
},
{
title: 'Price',
name: 'price'
},
{
title: 'Download',
name: 'downloadCount'
},
{
title: 'Listen',
name: 'listenCount'
}
]
});
grid.setData(gridData);
</script>
</html>