var datagrid;
var SBGridProperties = {};
function createGrid(){
SBGridProperties.parentid = 'SBGridArea';
SBGridProperties.id = 'datagrid';
SBGridProperties.jsonref = 'grid_data';
SBGridProperties.rowheader = 'seq';
SBGridProperties.explorerbar = 'sortmove';
SBGridProperties.selectmode = 'free';
SBGridProperties.mergecells = 'bycol';
SBGridProperties.columns = [
{caption : ['구분'], ref : "col0", width : '100px', style : 'text-align:center', type : 'input'},
{caption : ['분류'], ref : "col1", width : '100px', style : 'text-align:center', type : 'input'},
{caption : ['항목'], ref : "col2", width : '150px', style : 'text-align:center', type : 'input'},
{caption : ['1월'], ref : "col3", width : '100px', style : 'text-align:right', type : 'input', format : { type:'number' , rule:'#,##0.00' }, merge:false},
{caption : ['2월'], ref : "col4", width : '100px', style : 'text-align:right', type : 'input', format : { type:'number' , rule:'#,##0.00' }, merge:false},
{caption : ['3월'], ref : "col5", width : '100px', style : 'text-align:right', type : 'input', format : { type:'number' , rule:'#,##0.00' }, merge:false},
{caption : ['4월'], ref : "col6", width : '100px', style : 'text-align:right', type : 'input', format : { type:'number' , rule:'#,##0.00' }, merge:false},
{caption : ['5월'], ref : "col7", width : '100px', style : 'text-align:right', type : 'input', format : { type:'number' , rule:'#,##0.00' }, merge:false}
];
datagrid = _SBGrid.create(SBGridProperties);
};
function fnSetTotal() {
var objTotal = {
type : 'subgrand',
position : 'bottom',
columns : {
standard : [1,2],
sum : [4,5,6,7,8]
},
subtotalrow : {
1 : {
titlecol : 2,
titlevalue : '@ 소계',
style : 'background-color: rgb(146, 178, 197); font-weight: bold; color: rgb(255, 255, 255);',
stylestartcol : 2
},
2 : {
titlecol : 3,
titlevalue : '@ 소계',
style : 'background-color: rgb(146, 178, 197); font-weight: bold; color: rgb(255, 255, 255);',
stylestartcol : 3
}
},
grandtotalrow : {
titlecol : 1,
titlevalue : '합계',
style : 'background-color: rgb(146, 178, 197); font-weight: bold; color: rgb(255, 255, 255);',
stylestartcol : 1
},
datasorting : true
};
datagrid.setTotal(objTotal);
}