조사원 > 조사원 팝업: 체크박스 전체 선택/해제 로직 수정, 선택 값 유지 및 필터링 로직 개선

dev
박성영 4 months ago
parent 131c5cd16e
commit a1288a8ddc

@ -312,11 +312,14 @@
*/
onCheckAll: function(ev) {
var self = this;
this.selectedRows = [];
// 다른페이지에서 선택한 값도 유지하기 위해 주석
//this.selectedRows = [];
// 현재 페이지의 모든 행 데이터 추가
this.grid.instance.getData().forEach(function(row) {
self.selectedRows.push(row);
this.grid.instance.getData().forEach(function(rowData) {
if (!self.selectedRows.some(row => row.exmnrId === rowData.exmnrId)) {
self.selectedRows.push(rowData);
}
});
},
@ -324,7 +327,13 @@
* 전체 체크 해제 이벤트
*/
onUncheckAll: function(ev) {
this.selectedRows = [];
var self = this;
var currentData = this.grid.instance.getData();
this.selectedRows = this.selectedRows.filter(function (selectedRow) {
return !currentData.some(function (currentRow) {
return currentRow.exmnrId === selectedRow.exmnrId;
});
});
},
/**

Loading…
Cancel
Save