본문 바로가기
Nexacro/예제

[Nexacro] 그리드-그룹핑

by bjgu97 2021. 11. 24.
반응형

ex) CORP, DEPT별 소계 표현하기

// G: 그룹핑; CORP 내림차순, DEPT 오름차순
this.dataset.set_keystring("G:-CORP,+DEPT"); 

// 그룹핑하면 Level 갖게됨.
// 소계이면 -> CORP + sum 으로 / 소계 아니면 그냥 찍어주기.
var sExpr = "expr:(dataset.getRowLevel(currow) == 2 ? CORP+' Sum' : CORP)"; 

this.grid.setCellProperty("body", 0, "text", sExpr);
sExpr = "expr:(dataset.getRowLevel(currow) == 0 ? DEPT : (dataset.getRowLevel(currow) ==
this.grid.setCellProperty("body", 1, "text", sExpr);

 

ex) Summary 밴드 추가하고 SALARY 총 합계 나타내기

this.grid.appendContentsRow("summary"); // 마우스 눌러서 add Summary Row 한 것과 동일 기능.
this.grid.setCellProperty("summary", 4, "text", this.dataset.getSum("SALARY"));

 

ex) 소계와 Summary 밴드를 상단에 표현하기

// 직접 세팅 방법: Misc - reversesubsum - true
this.dataset.set_reversesubsum(true); // 상단으로 보내기

// 직접 세팅 방법: Grid - Appearance - summarytype - top
this.grid.set_summarytype("top");

댓글