xplatform 그리드헤더를 동적생성

/*==============================================================================
* 그리드 헤더 동적 생성 Function
*
*=============================================================================*/
function fn_setDynamicHeader()
{

var iGridHeadFixColIdx = 3; // 컬럼이 추가 되었을 경우 변경 필요함.(head)
var iGridFixColIdx = 3; // 컬럼이 추가 되었을 경우 변경 필요함.

//grd_result.enableredraw = false;

// 기존에 생성된 동적 Header 삭제
for(var ii=iGridFixColIdx, iLen=grd_result.getFormatColCount(); ii<iLen; ii++) {
grd_result.deleteContentsCol('body', iGridFixColIdx, false);
}

var iHeaderLength = ds_layout.getRowCount();

for(var ii=0; ii<iHeaderLength; ii++) {
// grid 컬럼 생성
grd_result.appendContentsCol();
grd_result.setFormatColProperty(iGridFixColIdx + ii, "size", 100);
grd_result.setCellProperty("Body", iGridFixColIdx + ii, "text","bind:"+ds_layout.getColumn(ii, "MDL_DEFINE_DT_NM_NM"));

grd_result.setCellProperty("Body", iGridFixColIdx + ii, "displaytype","normal");
grd_result.setCellProperty("Body", iGridFixColIdx + ii, "align","right middle");
//grd_result.mergeContentsCell("head",0,iGridFixColIdx + ii,1,iGridFixColIdx + ii,iGridFixColIdx + ii,false);
}

// Header 명
var ii = 0
for(ii=0; ii<iHeaderLength; ii++) {

grd_result.setCellProperty("Head", iGridHeadFixColIdx + ii, "text", ds_layout.getColumn(ii, "MDL_DEFINE_DT_NM_NM"));
grd_result.setCellProperty("Head", iGridHeadFixColIdx + ii, "displaytype", "normal");
//grd_result.setCellProperty("Head", iGridHeadFixColIdx + ii, "mask", "MM/dd");
}

//grd_result.enableredraw = true;

}

Leave a Reply

Your email address will not be published. Required fields are marked *