/******************************************************************************* ★ 설명 그리드 삭제 컬럼 전체 체크 ******************************************************************************/
function gf_gridDelChk(obj, cellNm, cellIdx)
{
var bindDs = eval(obj.binddataset);
var sTitle, sValue;
sTitle = obj.getCellProperty( "head", cellIdx, "text");
//sTitle = obj.getCellText(-1, cellIdx);
bindDs.enableevent = false;
if( sTitle == "삭제" )
{
sTitle = "삭제-All";
sValue = 1;
obj.setCellProperty( "head", cellIdx, "text", sTitle);
for(idx=0; idx<bindDs.rowcount; idx++)
{
if( bindDs.getRowType(idx)==Dataset.ROWTYPE_INSERT
|| bindDs.getRowType(idx)==Dataset.ROWTYPE_UPDATE )
{
continue;
}
bindDs.setColumn(idx,cellNm,sValue);
}
}
else
{
sTitle = "삭제"
sValue = "0";
obj.setCellProperty( "head", cellIdx, "text", sTitle);
for(idx=0; idx<bindDs.rowcount; idx++)
{
if( bindDs.getRowType(idx)==Dataset.ROWTYPE_INSERT
|| bindDs.getRowType(idx)==Dataset.ROWTYPE_UPDATE )
{
////trace("continue["+idx+"]::"+ bindDs.getRowType(idx));
if(bindDs.getColumn(idx,cellIdx-1)=="수정" || bindDs.getColumn(idx,cellIdx-1)=="입력" )
{
continue;
}
}
bindDs.setColumn(idx,cellNm,sValue);
}
}
bindDs.enableevent = true;
}
/******************************************************************************* ★ 설명 Grid Column Head Fix 하는 함수(Header Fix 컬러 변경) ★ parameter 1. obj:Grid : Grid Object ( 예 : Grid00 ) 2. nCellIdx : Click Event Object ( Grid Col Index ) ★ return - 성공 = true - 실패 = false ******************************************************************************/
function gf_gridColFix(obj:Grid, nCellIdx, sFixColor)
{
//trace( "gf_gridColFix["+nCellIdx+"/"+obj.getCellCount("Head")+"] ");
var nCell;
var sDefaultFixColor = "lightgrey";
var sDefaultBgImage = "URL('img::img_GridPil.png')";
for(nCell = 0; nCell <= nCellIdx; nCell++)
{
//obj.setFormatColProperty(nCell,"fix","");
obj.setFormatColProperty(nCell,"band","");
if( obj.getFormatColProperty(nCell,"band") == "right" ) break;
var bgProp = ""+obj.getCellProperty("head",nCell,"background");
////trace( "bgProp : " + obj.getCellProperty("head",nCell,"background") );
if( nCell <= nCellIdx )
{
////trace( "nCell : " + nCell );
obj.setFormatColProperty(nCell,"band","left");
if(bgProp==null || bgProp=="")
{
obj.setCellProperty("head",nCell,"background",sDefaultFixColor);
}
else if(sDefaultBgImage.indexOf(bgProp)!=-1 || sDefaultFixColor.indexOf(bgProp)!=-1)
{
obj.setCellProperty("head",nCell,"background",sDefaultFixColor + " " + bgProp);
}
else
{
////trace("nCel/IdxnCell ["+nCellIdx+"/" + nCell +"]="+bgProp);
obj.setCellProperty("head",nCell,"background",sDefaultFixColor);
}
}
else
{
obj.setFormatColProperty(nCell,"band","body");
if(bgProp==null || bgProp=="")
{
obj.setCellProperty("head",nCell,"background","");
}
else if(bgProp.indexOf(sDefaultBgImage)!=-1)
{
obj.setCellProperty("head",nCell,"background",obj.getCellProperty("head",nCell,"background"));
}
else
{
obj.setCellProperty("head",nCell,"background","");
}
}
//trace("background["+nCell+"] ===========>"+obj.getCellProperty("head",nCell,"background"));
}
}
/******************************************************************************* ★ 설명 Grid Column Head Fix 해제 하는 함수(Header Fix 컬러 변경) ★ parameter 1. obj:Grid : Grid Object ( 예 : Grid00 ) 2. nCellIdx : Click Event Object ( Grid Col Index ) 3. nStartIdx : 기본 Fix Column Index ******************************************************************************/
function gf_gridColFixFree(obj:Grid, nCellIdx, nStartIdx)
{
//trace( "gf_gridColFixFree["+nCellIdx+"/"+nStartIdx+"] ");
var nCell;
var sDefaultFixColor = "lightgrey";
var sDefaultBgImage = "URL('img::img_GridPil.png')";
var nStart = obj.getCellCount("Head") - 1;
//for(nCell = obj.getCellCount("Head"); nCell > 0 ; nCell--)
for(nCell = nStart; nCell > nStartIdx ; nCell--)
{
if( obj.getFormatColProperty(nCell,"band") == "right" || obj.getFormatColProperty(nCell,"band") == "body" )
continue;
//gridObj.setFormatColProperty(nCell-1,"fix","");
obj.setFormatColProperty(nCell,"band","body");
var bgProp = ""+obj.getCellProperty("head",nCell,"background");
//trace( "["+nCell+"/"+bgProp.indexOf(sDefaultBgImage)+"] "+sDefaultBgImage+" // bgProp = " + obj.getCellProperty("head",nCell,"background") );
if(bgProp==null || bgProp=="")
{
obj.setCellProperty("head",nCell,"background","");
}
else if(bgProp.indexOf("URL")!=-1)
{
obj.setCellProperty("head",nCell,"background",sDefaultBgImage);
}
else
{
obj.setCellProperty("head",nCell,"background","");
}
//trace("background["+nCell+"/"+nStartIdx+"] =========== "+obj.getCellProperty("head",nCell,"background"));
}
} |