본문 바로가기
Nexacro

[Nexacro] 창 닫을 때 confirm 창

by bjgu97 2021. 11. 23.
반응형

Form - Properties - Event - onbeforeclose : form이 닫히기 직전에 발생하는 이벤트.

 

 

this.Exe_dataset_onbeforeclose = function(obj:nexacro.Form, e:nexacro.CloseEventInfo) {
	if(this.fn_checkdata(this.dataset)) {
    		return "변경된 데이터가 존재합니다. 닫으시겠습니까?";
    }
};


// fn_checkdata 함수
this.fn_checkdata = function(objDs) {
  if(this.dataset.getDeletedRowCount() > 0) { // 삭제된 데이터가 있다면,
      return true;
  }

  for(var i = 0; i < this.dataset.rowcount; i++) {
      var nRowType = this.dataset.getRowType(i);
      if(nRowType == 2 || nRowType == 4) { // 신규나 변경된게 있다면,
          return true;
      }
  }
  return false;
}

댓글