내보내기 기능(excel, csv) 추가

design
minkyu 3 years ago
parent 6e4555416f
commit 809c45c40a

@ -274,11 +274,51 @@ let findData = ()=>{
<script type="text/javascript"> <script type="text/javascript">
const options = {
includeHiddensColumns: true,
onlySelected: true,
delimiter: '|',
fileName: '주민번호 CI 변환',
}
let exportExcel = (format) => {
instance.export(format, options);
}
//import Grid from 'tui-grid'; /* ES6 */ //import Grid from 'tui-grid'; /* ES6 */
const Grid = tui.Grid; const Grid = tui.Grid;
const instance = new Grid({ const instance = new Grid({
el: document.getElementById('grid'), // Container element el: document.getElementById('grid'), // Container element
contextMenu: ({ rowKey, columnName }) => (
// 2차원 배열을 반환
[
[
{
name: 'expt',
label: '내보내기',
subMenu: [
{
name: 'subExpt1',
label: 'Excel',
action: () => {
exportExcel('xlsx');
}
},
{
name: 'subExpt2',
label: 'CSV',
action: () => {
exportExcel('csv');
}
},
],
},
]
]
),
// data: { // data: {
// initialRequest: false, // initialRequest: false,
// api: { // api: {

Loading…
Cancel
Save