Angular 그리드 셀 데이터 수정 적용 안됨
페이지 정보
작성자 깜장머리 작성일 2023-12-14 09:38 조회 113회 댓글 0건본문
관련링크
그리드 외부의 삭제 버튼을 이용하여 row를 remove 또는 그리드 셀의 값(삭제구분)을 변경하고 싶습니다.
아래의 소스는 기존에 다른 사이트에서 사용하던 소스이며 정상적으로 작동 하였는데 제가 사용하는 시스템에서 delyn, modifyGbCd 값의 변경이 즉각 반영되지 않고 "체크박스 해제 또는 다른 수정 이벤트 등이 발생" 하여야 적용이 됩니다.
물론 event_initGrid 로 그리드를 다시 그려주면 깜빡하면서 적용이 되기는 하지만 데이터가 1천건정도의 그리드를 계속 다시 그려주는 방법말고 다른 해결책을 찾고 싶습니다.
html 파일
<wj-flex-grid #grid1
[itemsSource]="list1"
[selectionMode]="'Cell'"
(initialized)="event_initGrid('grid1', grid1)"
(cellEditEnding)="event_cellEditEnding('grid1', $event)">
</wj-flex-grid>
<wj-flex-grid #grid2
[itemsSource]="list2"
[selectionMode]="'Cell'"
(initialized)="event_initGrid('grid2', grid2)"
(cellEditEnding)="event_cellEditEnding('grid2', $event)">
</wj-flex-grid>
<button [type]="'DEL'" (click)="click_del('grid1')">
</button>
<button [type]="'DEL'" (click)="click_del('grid2')">
</button>
ts 파일
public click_del(gridId: string) {
let gridList: wjcCore.CollectionView = this.getGridList(gridId); // this.grid1;
gridList.beginUpdate();
for (let i = gridList.items.length - 1; i >= 0; i--) {
if (gridList.items[i].chkSel) {
gridList.itemsRemoved.push(gridList.items[i]);
if (gridList.items[i].modifyGbCd === "ADD") {
gridList.removeAt(i);
} else {
gridList.items[i].modifyGbCd = "DEL";
gridList.items[i].delYn = "Y";
}
}
}
//this.event_initGrid(gridId, this.grid1); //대용량1천건 이상 처리 때문에 지양
//gridList.commitEdit(); 소용없음
gridList.endUpdate();
gridList.currentPosition = -1;
}
댓글목록
등록된 댓글이 없습니다.