반응형
1. 구성요소
1) Property
form
url
async
returnvalue(P)
2) Method
setContents
closePopup(P)
isPopup(P)
trackPopup(P)
trackPopupByComponent(P)
3) Event
oncloseup(P)
2. 실습
1) popup을 버튼 하단에 띄움
this.btn_Exe1_1_onclick = function(obj:nexacro.Button,e:nexacro.ClickEventInfo)
{
var nX = 0;
//var nY = 0;
{
var nX = 0;
//var nY = 0;
var nY = obj.height;
// popup띄우는 메서드
this.PopupDiv1.trackPopupByComponent(this.btn_Exe1_1, nX, nY);
};
this.PopupDiv1_btn_Exe1_Close_onclick = function(obj:nexacro.Button,e:nexacro.ClickEventInfo)
{
this.PopupDiv1.trackPopupByComponent(this.btn_Exe1_1, nX, nY);
};
this.PopupDiv1_btn_Exe1_Close_onclick = function(obj:nexacro.Button,e:nexacro.ClickEventInfo)
{
// 값 선택 후 버튼 누르면 메인의 Edit Form에 정보 가져가기
var sDept = this.Dataset1.getColumn(this.Dataset1.rowposition, "DEPT_NAME");
var sName = this.Dataset1.getColumn(this.Dataset1.rowposition, "FULL_NAME");
var sID = this.Dataset1.getColumn(this.Dataset1.rowposition, "EMPL_ID");
var sDept = this.Dataset1.getColumn(this.Dataset1.rowposition, "DEPT_NAME");
var sName = this.Dataset1.getColumn(this.Dataset1.rowposition, "FULL_NAME");
var sID = this.Dataset1.getColumn(this.Dataset1.rowposition, "EMPL_ID");
this.edt_dept.set_value(sDept);
this.edt_name.set_value(sName);
this.edt_id.set_value(sID);
this.PopupDiv1.closePopup(); // Popup 닫기
};
{
var nX = parseInt(0);
var nY = parseInt(obj.height);
this.PopupDiv2.trackPopupByComponent(obj
, nX
, nY
, null
, null
, "fn_pDivCallback");
};
this.fn_pDivCallback = function(objID, rtnValue)
{
if(rtnValue == ""){
return;
}
if(objID == "PopupDiv2"){
this.edt_dept2.set_value(rtnValue[0]);
this.edt_name2.set_value(rtnValue[1]);
this.edt_id2.set_value(rtnValue[2]);
}
};
this.edt_name.set_value(sName);
this.edt_id.set_value(sID);
this.PopupDiv1.closePopup(); // Popup 닫기
};
2) Linked방식으로 메인의 Edit Form에 정보 가져가기
this.btn_Exe2_1_onclick = function(obj:nexacro.Button,e:nexacro.ClickEventInfo){
var nX = parseInt(0);
var nY = parseInt(obj.height);
this.PopupDiv2.trackPopupByComponent(obj
, nX
, nY
, null
, null
, "fn_pDivCallback");
};
this.fn_pDivCallback = function(objID, rtnValue)
{
if(rtnValue == ""){
return;
}
if(objID == "PopupDiv2"){
this.edt_dept2.set_value(rtnValue[0]);
this.edt_name2.set_value(rtnValue[1]);
this.edt_id2.set_value(rtnValue[2]);
}
};
======================================================
// url에 있는 close버튼 이벤트(Depth를 이용해 Array로 넘겨줘야 함)
this.btn_Exe2_Close_onclick = function(obj:nexacro.Button,e:nexacro.ClickEventInfo)
{
var arrRtn = [];
arrRtn[0] = this.Dataset2.getColumn(this.Dataset2.rowposition, "DEPT_NAME");
arrRtn[1] = this.Dataset2.getColumn(this.Dataset2.rowposition, "FULL_NAME");
arrRtn[2] = this.Dataset2.getColumn(this.Dataset2.rowposition, "EMPL_ID");
this.parent.parent.PopupDiv2.closePopup(arrRtn); // Popup 닫기
};
3) 달력 Popup 펼치기
this.Exe_Div_PopupDiv_onload = function(obj:nexacro.Form,e:nexacro.LoadEventInfo){
var objDate = new Date();
var sToday = objDate.getFullYear()
+ ((objDate.getMonth() + 1) + "").padLeft(2, '0')
+ (objDate.getDate() + "").padLeft(2, '0');
this.cal_from.set_value(sToday.substring(0,6) + "01");
this.cal_to.set_value(sToday);
};
this.cal_from_ondropdown = function(obj:nexacro.Calendar,e:nexacro.EventInfo)
{
this.PopupDiv3.form.cal_from.set_value(this.cel_from.value);
this.PopupDiv3.form.cal_to.set_value(this.cel_from.value);
this.PopupDiv3.trackPopupByComponent(this.cal_from, 0, obj.height);
};
// Confirm Button
this.PopupDiv3_btn_confirm_onclick = function(obj:nexacro.Button,e:nexacro.ClickEventInfo)
{
};
// Confirm Button
this.PopupDiv3_btn_confirm_onclick = function(obj:nexacro.Button,e:nexacro.ClickEventInfo)
{
var sFrom = this.PopupDiv3.form.cal_from.value;
var sTo = this.PopupDiv3.form.cal_to.value;
this.cal_from.set_value(sFrom);
this.cal_to.set_value(sTo);
this.PopupDiv3.closePopup();
};
this.PopupDiv3_btn_cancel_onclick = function(obj:nexacro.Button,e:nexacro.ClickEventInfo)
{
this.PopupDiv3.closePopup();
};
};
this.PopupDiv3_btn_cancel_onclick = function(obj:nexacro.Button,e:nexacro.ClickEventInfo)
{
this.PopupDiv3.closePopup();
};
// From이 To보다 날짜가 뒤라면 에러 띄우고 To를 초기화
this.PopupDiv3_oncloseup = function(obj:nexacro.PopupDiv,e:nexacro.EventInfo)
{
if(this.cal_from.value > this.cal_to.value){
this.alert("End Date Should be later than From Date");
this.cal_to.set_value("");
}
};
this.PopupDiv3_oncloseup = function(obj:nexacro.PopupDiv,e:nexacro.EventInfo)
{
if(this.cal_from.value > this.cal_to.value){
this.alert("End Date Should be later than From Date");
this.cal_to.set_value("");
}
};
반응형
'Frontend > Nexacro' 카테고리의 다른 글
[넥사크로] Form, Common (0) | 2023.07.07 |
---|---|
[넥사크로] Grid (0) | 2023.07.07 |
[넥사크로] Dataset (0) | 2023.07.07 |
[넥사크로] 넥사크로 플랫폼 이용 개발 시 주의사항 (0) | 2023.07.07 |
[넥사크로] 다시 해보기 (0) | 2023.07.07 |