var grid = new tui.Grid({
el: $('#grid'),
scrollX: false,
scrollY: false,
header: {
height: 60,
complexColumns: [
{
title : 'useViewMode: false',
name : 'c1-c2',
childNames : ['c1', 'c2']
},
{
title : 'useViewMode: true',
name : 'c3-c4',
childNames : ['c3', 'c4']
},
{
title: 'DateTimePicker',
name: 'c5'
},
{
title: 'MonthPicker',
name: 'c6'
},
{
title: 'YearPicker',
name: 'c7'
}
]
},
columnOptions: {
width: 100
},
columns: [
{
title: 'DatePicker (Off)',
name: 'c1',
editOptions: {
type: 'text',
useViewMode: false
}
},
{
title: 'DatePicker (Default)',
name: 'c2',
editOptions: {
type: 'text',
useViewMode: false
},
component: {
name: 'datePicker'
}
},
{
title: 'DatePicker (Using options)',
name: 'c3',
editOptions: {
type: 'text'
},
component: {
name: 'datePicker',
options: {
date: new Date(2017, 3, 10),
format: 'dd/MM/yyyy'
}
}
},
{
title: 'DatePicker (selectableRanges)',
name: 'c4',
editOptions: {
type: 'text'
},
component: {
name: 'datePicker',
options: {
date: new Date(2014, 3, 10),
selectableRanges: [
[new Date(2014, 3, 10), new Date(2014, 5, 20)]
]
}
}
},
{
title: 'Date-TimePicker',
name: 'c5',
editOptions: {
type: 'text',
useViewMode: false
},
component: {
name: 'datePicker',
options: {
format: 'yyyy-MM-dd HH:mm A',
timepicker: true
}
}
},
{
title: 'MonthPicker',
name: 'c6',
editOptions: {
type: 'text',
useViewMode: false
},
component: {
name: 'datePicker',
options: {
format: 'yyyy-MM',
type: 'month'
}
}
},
{
title: 'YearPicker',
name: 'c7',
editOptions: {
type: 'text',
useViewMode: false
},
component: {
name: 'datePicker',
options: {
format: 'yyyy',
type: 'year'
}
}
}
]
});
var gridData = [];
(function() {
_.times(20, function(number) {
gridData.push({ });
})
})();
grid.setData(gridData);