STUDY ROOM
Dataset For문 본문
1. grid에서 조건에 만족하는 컬럼을 가져오기
for(var i = 0 ; i < this.ds_main.getRowCount() ; i++) {
var a = String(this.ds_main.getColumn(i, "A컬럼명"));
var b = String(this.ds_main.getColumn(i, "B컬럼명"));
var lastRow = this.ds_main.getRowCount;
if(a=='1' && b=='1'){
this.ds_main.setColumn(i,"A컬럼명",''); //A 컬럼안의 값을 공백으로 준다
this.ds_main.setColumn(i,"B컬럼명",'hello'); //B 컬럼안의 값을 hello로 준다
}else if(a=='0' && b=='1'){
this.ds_main.setColumn(i,"A컬럼명",'hello'); //A 컬럼안의 값을 hello로 준다
this.ds_main.setColumn(i,"B컬럼명",''); //B 컬럼안의 값을 공백으로 준다
}else if(a=='0' && b==''){
this.ds_main.filterRow(i,lastRow-1); //마지막 열을 숨기기(데이터자체에 총계가 있을 때 유용)
}
}
- for문은 callback 안에서 실행
- 데이터 타입 확인을 잘 할 것
'Nexacro' 카테고리의 다른 글
특정 셀에 포커스 이동하기(setCellPos 메소드) (0) | 2020.04.27 |
---|---|
중간소계(Subsumtext) 에 color 표시하기 (0) | 2020.03.31 |
그리드에서 특정 컬럼만 보이게 하기 (체크박스) (0) | 2020.03.24 |
그리드에서 특정 컬럼만 보이게 하기 (콤보박스) (0) | 2020.03.23 |
Dataset의 그룹핑 ,소계 구하기 (0) | 2020.03.06 |