dhtml 그리드 자체 합계 기능 사용 카테고리 없음2016. 10. 11. 11:53
[ dhtml 그리드 자체 소계 기능 사용 ]
//그리드 폼정의
myGrid.customGroupFormat=function(name, count){
return name+" 소계 : ";
};
myGrid.customGroupFormat=function(name, count){
return "권종 "+name+" 매출금액 합계 : ";
};
//조회 콜백에
//브랜드명별 소계
myGrid.groupBy(myGrid.getColIndexById("BRAND_NM"), ["#title","#cspan","#cspan","#cspan","#cspan","#cspan","#cspan","#cspan","#stat_total","#stat_total","#stat_total","#stat_total"]);
//footer
if(0 < myGrid.getRowsNum()){
fn_calculateFooterValues();
}
[ dhtml 그리드 자체 합계 기능 사용 ]
prmsb6051 파일에 보면.. (기본적인 sum 함수 사용)
myGrid.setColTypes("ro,ro,ro,ro,ro,ro,ro,ro,ro,ron,ron,ron,ron,ron,ro,ron,ron,ron,ron,ron,ron,ron,ron,ron,ron,ron");
myGrid.setColSorting("int,str,str,int,str,str,str,str,str,int,int,int,int,int,str,int,int,int,int,int,int,int,int,int,int,int");
myGrid.setNumberFormat("0,000", myGrid.getColIndexById("SUM_AMT"));
myGrid.setNumberFormat("00.00", myGrid.getColIndexById("RET_RATE"));
var footerCol = "<div id='T_COUNT'>합 계</div>,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,#cspan,";
footerCol = footerCol + "<div id='SUM_ORD_QTY'>{#stat_total}</div>,"
footerCol = footerCol + ",#cspan,"
footerCol = footerCol + "<div id='SUM_ORD_SALEAMT'>{#stat_total}</div>,,<div id='SUM_OUT_QTY'>{#stat_total}</div>,<div id='SUM_OUT_AMT'>{#stat_total}</div>,"
+ "<div id='SUM_JUM_30_CNT'>{#stat_total}</div>,<div id='SUM_JUM_30_AMT'>{#stat_total}</div>,"
+ "<div id='SUM_JUM_40_CNT'>{#stat_total}</div>,<div id='SUM_JUM_40_AMT'>{#stat_total}</div>,<div id='SUM_JUM_45_CNT'>{#stat_total}</div>,"
+ "<div id='SUM_JUM_45_AMT'>{#stat_total}</div>,<div id='SUM_SUM_CNT'>{#stat_total}</div>,<div id='SUM_SUM_AMT'>{#stat_total}</div>,"
+ "<div id='SUM_RET_RATE'></div>";
myGrid.attachFooter(footerCol,
["font-weight:bold;text-align:center;height:18px","","","","","","","","","",
"background-color:white;font-weight:bold;text-align:right",
"",
"",
"background-color:white;font-weight:bold;text-align:right","font-weight:bold;text-align:center;height:18px",
"background-color:white;font-weight:bold;text-align:right","background-color:white;font-weight:bold;text-align:right",
"background-color:white;font-weight:bold;text-align:right","background-color:white;font-weight:bold;text-align:right","background-color:white;font-weight:bold;text-align:right",
"background-color:white;font-weight:bold;text-align:right","background-color:white;font-weight:bold;text-align:right","background-color:white;font-weight:bold;text-align:right",
"background-color:white;font-weight:bold;text-align:right","background-color:white;font-weight:bold;text-align:right","background-color:white;font-weight:bold;text-align:right"
]);
[ dhtml 그리드 합계 기능 구현 ]
따로 함수로 만들어서 구현 가능.