var datagrid;
var SBGridProperties = {};
function createGrid(){
SBGridProperties.parentid = 'SBGridArea';
SBGridProperties.id = 'datagrid';
SBGridProperties.jsonref = 'ct_data.resources';
SBGridProperties.rowheader = ['seq', 'update'];
SBGridProperties.selectmode = 'free'
SBGridProperties.columns = [
{caption : ['학원명'], ref : 'academy', width : '168px', style : 'text-align:left', type : 'input'},
{caption : ['설립자(성명)'], ref : 'name', width : '163px', style : 'text-align:left', type : 'output'},
{caption : ['전화번호'], ref : 'phone', width : '120px', style : 'text-align:center', type : 'input'},
{caption : ['학원주소'], ref : 'addr', width : '407px', style : 'text-align:left', type : 'textarea'},
{caption : ['교습과정'], ref : 'curriculum', width : '100px', style : 'text-align:center', type : 'combo', typeinfo : {ref : 'newComboData', displayui : true, label : 'label', value : 'value'}},
{caption : ['교습과목(반)'], ref : 'class2', width : '100px', style : 'text-align:center', type : 'combo', typeinfo : {ref : 'classData', displayui : true, label : 'label', value : 'value', filtering : {usemode : true, uppercol : 5, attrname : 'code'}}},
{caption : ['교육시작일'], ref : 'startday', width : '100px', style : 'text-align:center', type : 'datepicker', typeinfo : {locale : 'ko' , dateformat :'yymmdd'}, format : {type:'date', rule:'yyyy-mm-dd', origin : 'yyyymmdd' }},
{caption : ['교육종료일'], ref : 'endday', width : '100px', style : 'text-align:center', type : 'inputdate', typeinfo : {locale : 'ko' , dateformat :'yymmdd'}, format : {type:'date', rule:'yyyy-mm-dd', origin : 'yyyymmdd' }},
{caption : ['바로가기'], ref : 'link', width : '100px', style : 'text-align:left', type : 'outputbutton'}
];
datagrid = _SBGrid.create(SBGridProperties);
$('#textValue').text('열 인덱스와 검색어를 입력하고 버튼을 눌러 검색된 행을 확인해보세요.');
};
function fnFindCell(){
var data = $('#idx').val();
var nRow = parseInt($('#nRow').val());
var nCol = parseInt($('#nCol').val());
var label = $('#label').val();
var casesense, fullmatch;
if($('#nRow').val() == ''){
nRow = -1;
}
if($('#nCol').val() == ''){
nCol = -1;
}
if($('#casesense').val() === 'true'){
casesense = true;
}else{
casesense = false;
}
if($('#fullmatch').val() === 'true'){
fullmatch = true;
}else{
fullmatch = false;
}
var cellIndex = datagrid.findCell(data, nRow, nCol, casesense, fullmatch, label);
console.log(cellIndex);
$('#textValue').text('검색한 셀의 행 인덱스 : '+cellIndex[0]+'열 인덱스 : '+cellIndex[1]+' ');
}