NEXACRO 17
스크립트 중복 데이터 제거 FOR문
IT History
2023. 4. 25. 10:19
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
반응형