본문 바로가기
NEXACRO 17

스크립트 중복 데이터 제거 FOR문

by IT History 2023. 4. 25.
728x90
반응형
FOR문 중복 제거
for(i = 0; i < this.popupList.rowcount; i++) {
var duflag = false;
    for(j = 0; j < this.grid.rowcount; j++) {
        if( this.grid.getColumn(j, "ID") == this.popupList.getColumn(i, "ID")){
            duflag= true;
        }
    }
    //중복이 아닐경우 입력
    if(!duflag){
        var idx = this.grid.addRow();
        this.grid.setColumn(idx, "ID", this.popupList.getColumn(i, "ID"));
        this.grid.setColumn(idx, "NAME", this.popupList.getColumn(i, "NAME"));
        this.grid.setColumn(idx, "DEPT", this.popupList.getColumn(i, "DEPT"));
        this.grid.setColumn(idx, "POST", this.popupList.getColumn(i, "POST"));
    }
}
728x90
반응형

'NEXACRO 17' 카테고리의 다른 글

NEXACRO 로딩이미지 보여주기  (1) 2023.11.23

댓글