123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936 |
- <?xml version="1.0" encoding="utf-8"?>
- <FDL version="1.5">
- <TypeDefinition url="..\default_typedef.xml"/>
- <Form id="cp_comCodeChk" classname="cp_cargoMode" inheritanceid="" position="absolute 0 0 120 20" titletext="CheckBox Combo" onload="cp_comCodeChk_onload" onsize="cp_comCodeChk_onsize">
- <Layouts>
- <Layout>
- <Edit id="edt_comCode" taborder="1" imemode="alpha" inputmode="upper" inputfilter="dot,comma,sign,symbol,space" inputtype="numberandenglish" onkeydown="fn_keyDown" ontextchanged="edt_comCode_ontextchanged" style="cursor:arrow;" anchor="left top right" position="absolute 0 0 120 20" positiontype="position" readonly="true" class="ComboList"/>
- <Button id="btn_dropDown" taborder="1" onclick="btn_dropDown_onclick" class="Combo_list_dropbtn" anchor="top right" position="absolute 100 1 119 19" positiontype="position" visible="true"/>
- <PopupDiv id="pdp_codeList" oncloseup="pdp_codeList_oncloseup" onpopup="pdp_codeList_onpopup" onsetfocus="pdp_codeList_onsetfocus" scrollbars="none" visible="false" position="absolute 0 26 120 166" anchor="left top right" positiontype="position">
- <Layouts>
- <Layout>
- <Grid id="grd_codeList" class="Combo_grid" taborder="1" binddataset="ds_comCode" scrollbars="autovert" useinputpanel="false" autofittype="none" onkeydown="pdp_codeList_grd_codeList_onkeydown" oncellclick="pdp_codeList_grd_codeList_oncellclick" anchor="all" position="absolute 0 20 120 140" positiontype="position">
- <Formats>
- <Format id="default">
- <Columns>
- <Column size="20"/>
- <Column size="40"/>
- <Column size="80"/>
- </Columns>
- <Rows>
- <Row size="24"/>
- </Rows>
- <Band id="body">
- <Cell displaytype="checkbox" edittype="none" text="bind:chk"/>
- <Cell col="1" style="align:left middle;" text="bind:cd"/>
- <Cell col="2" style="align:left middle;" text="bind:cdNm"/>
- </Band>
- </Format>
- </Formats>
- </Grid>
- <Edit id="edt_comCode" taborder="1" imemode="alpha" inputmode="upper" inputfilter="dot,comma,sign,symbol,space" inputtype="numberandenglish" onsetfocus="pdp_codeList_edt_comCode_onsetfocus" onkeydown="fn_keyDown" ontextchanged="pdp_codeList_edt_comCode_ontextchanged" position="absolute 0 0 120 20" style="cursor:arrow;" anchor="default" positiontype="position" readonly="true" class="ComboList"/>
- <Button id="btn_dropDown" taborder="1" onclick="fn_showHideList" class="Combo_list_dropbtn" position="absolute 100 1 119 19" positiontype="position"/>
- </Layout>
- </Layouts>
- </PopupDiv>
- </Layout>
- </Layouts>
- <Objects>
- <Dataset id="ds_comCode" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false" oncolumnchanged="ds_comCode_oncolumnchanged">
- <ColumnInfo>
- <Column id="chk" type="STRING" size="256"/>
- <Column id="cd" type="STRING" size="256"/>
- <Column id="cdNm" type="STRING" size="256"/>
- </ColumnInfo>
- </Dataset>
- </Objects>
- <Script type="xscript4.0"><![CDATA[/***************************************************************************************
- * System Name : KMTC
- * Job Name : Composite
- * File Name : cp_comCode.xfdl
- * Creator : TOBESOFT
- * Make Date : 2013.01.18
- *
- * Description : multi select combo component
- *---------------------------------------------------------------------------------------
- * Modify Date Modifier Modify Description
- *---------------------------------------------------------------------------------------
- * 2013.01.18 TOBESOFT Initial Make Program
- *
- *---------------------------------------------------------------------------------------
- ****************************************************************************************/
- //=======================================================================================
- // Common Lib Include
- //---------------------------------------------------------------------------------------
- //include "Lib::xCommon.xjs";
- //
- //=======================================================================================
- // Global Form Variable
- //---------------------------------------------------------------------------------------
- var iv_aRtn;
- var iv_sCode = "";
- var iv_sData = "";
- var iv_nCdSize = 40;
- var iv_nNameSize = 80;
- var iv_oDefaultFont = ufn_getObjFont(9,"Tahoma");
- var iv_nCarePos;
- var iv_sDelMode = false;
- var iv_codeGrp;
- var iv_event;
- var lv_cd;
- var lv_cdNm;
- var lv_AllChk;
- var lv_addItem = 0;
- /****************************************************************************************
- * Description : Form Initialization
- * Argument : obj : Object Event has occurred
- * : e : Event Object
- * return :
- ****************************************************************************************/
- function cp_comCodeChk_onload(obj:Form, e:LoadEventInfo)
- {
- try{
- // iv_codeGrp = codeGrp;
- }catch(e){}
- }
- //=======================================================================================
- // Event
- //---------------------------------------------------------------------------------------
- /****************************************************************************************
- * Description : dataset oncolumnchanged
- * Argument : obj Dataset
- e DSColChangeEventInfo
- * return : none
- ****************************************************************************************/
- function ds_comCode_oncolumnchanged(obj:Dataset, e:DSColChangeEventInfo)
- {
- if(lv_AllChk)
- {
- if(e.row == 0)
- {
- ds_comCode.enableevent = false;
- if(e.newvalue == "1")
- {
- for(var i=1; i < ds_comCode.getRowCount(); i++)
- {
- ds_comCode.setColumn(i, "chk", "1");
- }
- }
- else
- {
- for(var i=1; i < ds_comCode.getRowCount(); i++)
- {
- ds_comCode.setColumn(i, "chk", "0");
- }
- }
- ds_comCode.enableevent = true;
-
- ufn_returnDataValue();
- }
- }
- }
- //=======================================================================================
- // User Function
- //---------------------------------------------------------------------------------------
- /****************************************************************************************
- * Description : Font Object 생성 반환
- * Argument : nFontSize 폰트 크기
- sFontName 폰트 이름
- * return : Font Object
- ****************************************************************************************/
- function ufn_getObjFont(nFontSize, sFontName)
- {
- var objFont = new Font;
- objFont.size = nFontSize;
- objFont.name = sFontName;
- objFont.bold = true;
- return objFont;
- }
- /****************************************************************************************
- * Description : 1depth 메뉴 Text Size 반환
- * Argument : sText (사이즈를 계산할 텍스트 )
- * objFont(Font정보를 가지고 있는 object입니다.)
- * iLimitWidth (Option : word wrap이 일어나는 문자열 길이 제한 정수 값)
- * sConstWordWrapOption (Option : word wrap 옵션입니다)
- * return : 계산된 사이즈가 저장된 Size object
- ****************************************************************************************/
- function ufn_getTextSize(sText, objFont, iLimitWidth, sConstWordWrapOption)
- {
- var objPainter = this.canvas.getPainter();
- if(ufn_isNull(objPainter)==false)
- {
- var objTextSize = objPainter.getTextSize(sText, objFont);
- return objTextSize;
- }else
- {
- return false;
- }
- }
- /****************************************************************************************
- * Description : 입력값이 null 또는 wihte space로만 이루어져 있는지 확인 하는 함수
- * Argument : value 입력값
- * return : boolean. null(혹은 white space) 여부
- ****************************************************************************************/
- function ufn_isNull(sValue)
- {
- if (new String(sValue).valueOf() == "undefined") return true;
- if (sValue == null) return true;
-
- var lv_sChkStr = new String(sValue);
- if (lv_sChkStr == null) return true;
- if (lv_sChkStr.toString().length == 0 ) return true;
- return false;
- }
- /****************************************************************************************
- * Description : 입력값이 null 또는 wihte space로만 이루어져 있으면 빈문자를 리턴하는 함수
- * Argument : sValue String
- * return : String
- ****************************************************************************************/
- function ufn_isEmpty(sValue)
- {
- if (new String(sValue).valueOf() == "undefined") return "";
- if (sValue == null) return "";
- var lv_sChkStr = new String(sValue);
- if (lv_sChkStr == null) return "";
- if (lv_sChkStr.toString().length == 0 ) return "";
- return sValue;
- }
- /****************************************************************************************
- * Description : 컴포지트 이벤트 호출 함수
- * Argument : sEventId - 호출할 이벤트 ID
- * sCompNm - 컴포지트명
- * @return N / A
- ****************************************************************************************/
- function ufn_compositeEvent(sEventId,sCompNm)
- {
- var lv_oFrame = this.getOwnerFrame();
-
- var lv_bInhForm = ufn_isNull(lv_oFrame.bInhForm) ? false : lv_oFrame.bInhForm;
- var lv_bMdiForm = ufn_isNull(lv_oFrame.bMdiForm) ? false : lv_oFrame.bMdiForm;
- var lv_bMdiPopForm = ufn_isNull(lv_oFrame.bMdiPopForm) ? false : lv_oFrame.bMdiPopForm;
-
- try{
- if(lv_bInhForm)
- {
- if(lv_bMdiForm == true || lv_bMdiPopForm == true)
- {
- if(ufn_isNull(sCompNm))
- {
- eval("this.getOwnerFrame().form.div_Layout.div_Work."+sEventId+"()");
- }
- else
- {
- eval("this.getOwnerFrame().form.div_Layout.div_Work."+sEventId+"('"+sCompNm+"')");
- }
- }
- else
- {
- if(ufn_isNull(sCompNm))
- {
- eval("this.getOwnerFrame().form."+sEventId+"()");
- }
- else
- { ;
- eval("this.getOwnerFrame().form."+sEventId+"('"+sCompNm+"')");
- }
- }
- }
- else
- {
- if(ufn_isNull(sCompNm))
- {
- eval(sEventId+"()");
- }
- else
- {
-
- eval(sEventId+"('"+sCompNm+"')");
- }
- }
- }catch(err){}
- }
- /****************************************************************************************
- * Description : User Composite Get Data Method
- * Argument : none
- * return : array
- ****************************************************************************************/
- function getData()
- {
- iv_aRtn = new Array(2);
- iv_aRtn[0] = ufn_isEmpty(iv_sCode);
- iv_aRtn[1] = ufn_isEmpty(iv_sData);
- return iv_aRtn;
- }
- /****************************************************************************************
- * Description : User Composite Set Data Method
- * Argument : value
- * return : none
- ****************************************************************************************/
- function setData(sData)
- {
- if(!ufn_isNull(sData))
- {
- iv_sCode = sData;
- // trace("adfasd :: "+iv_sCode);
- ufn_setDataChk(sData);
-
- }else{
- iv_sCode = "";
- iv_sData = "";
- ufn_setDataChk();
- fn_setData();
- }
- }
- /****************************************************************************************
- * Description : User Composite chkeck value
- * Argument : none
- * return : none
- ****************************************************************************************/
- function ufn_setDataChk(sData)
- {
- //초기화 처리
- // if(ufn_isNull(iv_sCode)){
- for(var i=0;i<ds_comCode.rowcount; i++){
- ds_comCode.setColumn(i,"chk","0");
- }
-
- iv_sCode = sData;
- edt_comCode.value = null;
- pdp_codeList.edt_comCode.value = "";
-
- var lv_nSelRow;
-
- if(!utlf_isNull(iv_sCode)){
- lv_aCode = iv_sCode.split(",");
- iv_sData = "";
- if(lv_aCode.length == 0)
- {
- lv_nSelRow = ds_comCode.findRow(lv_cd,iv_sCode);
- if(lv_nSelRow > -1)
- {
- ds_comCode.setColumn(lv_nSelRow,"chk","1");
- iv_sData = ds_comCode.getColumn(lv_nSelRow,lv_cdNm);
- }
- }
- else
- {
- for(var i=0; i<lv_aCode.length; i++)
- {
- lv_nSelRow = ds_comCode.findRow(lv_cd,lv_aCode[i]);
- if(lv_nSelRow > -1)
- {
- ds_comCode.setColumn(lv_nSelRow,"chk","1");
-
- if(iv_sData.length == 0)
- {
- iv_sData = ds_comCode.getColumn(lv_nSelRow,lv_cdNm);
- }
- else
- {
- iv_sData = iv_sData+","+ds_comCode.getColumn(lv_nSelRow,lv_cdNm);
- }
- }
- }
- }
- fn_setData();
- }
- }
- /****************************************************************************************
- * Description : User Composite data setting
- * Argument : none
- * return : none
- ****************************************************************************************/
- function fn_setData()
- {
- edt_comCode.value = iv_sData;
- if(!ufn_isNull(iv_event)) ufn_compositeEvent(iv_event,this.name);
- }
- /****************************************************************************************
- * Description : User Composite Set Call event
- * Argument : sEvent string
- * return : none
- ****************************************************************************************/
- function setCallEvent(sEvent)
- {
- iv_event = sEvent;
- }
- /****************************************************************************************
- * Description : User Composite 컴포지트 필수 표시 함수 입력값은 : true / false
- * Argument : bReq true/false
- * return : none
- ****************************************************************************************/
- function setRequestment(bReq)
- {
- if(bReq)
- {
- edt_comCode.class = "ComboList_essential";
- pdp_codeList.edt_comCode.class = "ComboList_essential";
- }
- else
- {
- edt_comCode.class = "ComboList";
- pdp_codeList.edt_comCode.class = "ComboList";
- }
- }
- /****************************************************************************************
- * Description : User Composite enable setting
- * Argument : bReq true/false
- * return : none
- ****************************************************************************************/
- function setEnbale(bReq)
- {
- btn_dropDown.enable = bReq;
- edt_comCode.enable = bReq;
- }
- /****************************************************************************************
- * Description : User Composite dataset bind
- * Argument : oDataset dataset Object
- sCode code column string
- sCodeName data column string
- * return : none
- ****************************************************************************************/
- function setBindDataset(oDataset, sCode, sCodeName)
- {
- if((!ufn_isNull(oDataset) && oDataset.rowcount > 0) && !ufn_isNull(sCode) && !ufn_isNull(sCodeName) )
- {
- lv_cd = sCode; //code 컬럼 아이디
- lv_cdNm = sCodeName; //data 컬럼 아이디
- ds_comCode.clearData();
- ds_comCode.copyData(oDataset,true);
-
- pdp_codeList.grd_codeList.setCellProperty("Body", 1, "text", "bind:"+sCode);
- pdp_codeList.grd_codeList.setCellProperty("Body", 2, "text", "bind:"+sCodeName);
-
- ds_comCode.addColumn("chk","String");
-
- fn_setDefault();
- }
- }
- /****************************************************************************************
- * Description : User Composite Combo Item Add
- * Argument : sCode - String codedata
- sData - String name data
- sOpt - String insert or append ("top" : insertRow, addRow())
- bAllChk - All Check true/false
- * return : none
- ****************************************************************************************/
- function setAddItem(sCode, sData, sOpt, bAllChk)
- {
- if(lv_addItem == 0){
- if(bAllChk == "Y" || sOpt == "top")
- {
- ds_comCode.insertRow(0);
- ds_comCode.setColumn(0, lv_cd , sCode);
- ds_comCode.setColumn(0, lv_cdNm , sData);
- }
- else
- {
- var nRow = ds_comCode.addRow();
- ds_comCode.setColumn(nRow, lv_cd , sCode);
- ds_comCode.setColumn(nRow, lv_cdNm , sData);
- }
- lv_addItem++;
- }
-
- //전체 체크여부
- if(bAllChk == true || bAllChk == false)
- {
- lv_AllChk = bAllChk;
-
- if(bAllChk == true ){
- ds_comCode.enableevent = false;
- for(var i=0; i < ds_comCode.getRowCount(); i++)
- {
- ds_comCode.setColumn(i, "chk", "1");
- }
- ds_comCode.enableevent = true;
-
- }else{
-
- ds_comCode.enableevent = false;
- for(var i=0; i < ds_comCode.getRowCount(); i++)
- {
- ds_comCode.setColumn(i, "chk", "0");
- }
- ds_comCode.enableevent = true;
- }
- ufn_returnDataValue();
- fn_setData();
- }
- }
- /****************************************************************************************
- * Description : User Composite Combo Item Delete
- * Argument : sCode - String codedata
- bAllChk - All Check true/false
- * return : none
- ****************************************************************************************/
- function setRemoveItem(sCode, bAllChk)
- {
-
- var nRow = ds_comCode.findRow(lv_cd,sCode);
-
- if(nRow > -1)
- {
- ds_comCode.deleteRow(nRow);
- }
-
- ufn_returnDataValue();
-
- //전체 체크여부
- if(bAllChk)
- {
- lv_AllChk = bAllChk;
- }
-
- }
- /****************************************************************************************
- * Description : User Composite default setting
- * Argument : none
- * return : none
- ****************************************************************************************/
- function fn_setDefault()
- {
- pdp_codeList.position.width = edt_comCode.position.width;
- pdp_codeList.edt_comCode.position.width = this.position.width;
- // pdp_codeList.btn_dropDown.position.right = this.position.width;
- // pdp_codeList.btn_dropDown.position.left = pdp_codeList.btn_dropDown.position.right - 18;
- pdp_codeList.btn_dropDown.position.x = pdp_codeList.position.width - 19;
-
- var lv_nDrSize = this.position.width;
- var lv_oCdSize;
- var lv_oCdNmSize;
- for(var i=0; i<ds_comCode.rowcount; i++)
- {
- lv_oCdSize = ufn_getTextSize(ds_comCode.getColumn(i, lv_cd ),iv_oDefaultFont);
- lv_oCdNmSize = ufn_getTextSize(ds_comCode.getColumn(i, lv_cdNm),iv_oDefaultFont);
-
- if(lv_oCdSize.cx+20 > iv_nCdSize)
- {
- iv_nCdSize = lv_oCdSize.cx+20;
- }
-
- if(lv_oCdNmSize.cx+20 > iv_nNameSize)
- {
- iv_nNameSize = lv_oCdNmSize.cx+20;
- }
- }
-
- if(this.novisiblecodeYn == "Y") {
- pdp_codeList.grd_codeList.setFormatColProperty(1, "size", 0);
- } else {
- if(iv_nCdSize > 40)
- {
- pdp_codeList.grd_codeList.setFormatColProperty(1,"size",iv_nCdSize);
- }
- }
-
- if(iv_nNameSize > 80)
- {
- pdp_codeList.grd_codeList.setFormatColProperty(2,"size",iv_nNameSize);
- }
-
- if(lv_nDrSize < (iv_nCdSize+iv_nNameSize))
- {
- lv_nDrSize = iv_nCdSize+iv_nNameSize;
- }
- else
- {
- iv_nNameSize = lv_nDrSize - pdp_codeList.grd_codeList.getFormatColProperty(0,"size")- iv_nCdSize;
- pdp_codeList.grd_codeList.setFormatColProperty(2,"size",iv_nNameSize);
- }
-
- pdp_codeList.position.width = lv_nDrSize;
- ds_comCode.selectRow(0);
-
- }
- /****************************************************************************************
- * Description : User Composite popupdiv close
- * Argument : none
- * return : none
- ****************************************************************************************/
- function fn_showHideList()
- {
- pdp_codeList.closePopup();
- }
- /****************************************************************************************
- * Description : User Composite key text check - 데이터셋 코드 필터
- * Argument : none
- * return : none
- ****************************************************************************************/
- function fn_keyTextChk(obj,e)
- {
- ds_comCode.filter("");
- var lv_sCode = obj.value;
-
- if(!ufn_isNull(lv_sCode))
- {
- if(gfn_isCodeChar(lv_sCode))
- {
- ds_comCode.filter("cd.toString().indexOf('"+lv_sCode+"') == 0");
- }
- }
-
- ds_comCode.selectRow(0);
- }
- /****************************************************************************************
- * Description : User Composite key event
- * Argument : none
- * return : none
- ****************************************************************************************/
- function fn_keyDown(obj,e)
- {
- iv_sDelMode = false;
-
- //엔터키입력시
- if(e.keycode == 13)
- {
-
- if(!pdp_codeList.isPopup())
- {
- var sCompNm = this.name;
- if(sCompNm.indexOf("_S") > -1)
- {
- ufn_compositeEvent("ufn_search","");
- }
- }
- else
- {
- if(pdp_codeList.grd_codeList.rowcount > 0)
- {
- iv_sCode = "";
- iv_sData = "";
- for(var i=0; i<pdp_codeList.grd_codeList.rowcount; i++)
- {
- if(ds_comCode.getColumn(i,"chk") == "1")
- {
- if(iv_sCode.length == 0)
- {
- iv_sCode = ds_comCode.getColumn(i,lv_cd);
- iv_sData = ds_comCode.getColumn(i,lv_cdNm);
- }
- else
- {
- iv_sCode += ","+ds_comCode.getColumn(i,lv_cd);
- iv_sData += ","+ds_comCode.getColumn(i,lv_cdNm);
- }
- }
- }
-
- fn_setData();
- pdp_codeList.closePopup();
- }
- }
- }
- /*
- //엔터키입력시
- if(e.keycode == 9)
- {
- pdp_codeList.closePopup();
- }
- //방향키 아래로 이동시
- if(e.keycode == 40)
- {
- pdp_codeList.grd_codeList.setFocus();
- }
-
- if(e.keycode == 8 || e.keycode == 46)
- {
- iv_sDelMode = true;
- iv_sCode = "";
- iv_sData = "";
- }
- */
- }
- /****************************************************************************************
- * Description : User Composite Set Check event
- * Argument : 1.obj : grid object
- 2.e : GridClickEventInfo
- * return :
- ****************************************************************************************/
- function pdp_codeList_grd_codeList_oncellclick(obj:Grid, e:GridClickEventInfo)
- {
- if(ds_comCode.getColumn(e.row,"chk") == "1")
- {
- ds_comCode.setColumn(e.row,"chk","0");
- }
- else
- {
- ds_comCode.setColumn(e.row,"chk","1");
- }
- }
- /****************************************************************************************
- * Description : User Composite down Button Click
- * Argument : 1.obj : Button object
- 2.e : ClickEventInfo
- * return :
- ****************************************************************************************/
- function btn_dropDown_onclick(obj:Button, e:ClickEventInfo)
- {
- ds_comCode.filter("");
- ufn_setDataChkPopOpen();
- fn_popupOpen();
- }
- /****************************************************************************************
- * Description : User Composite chkeck value
- * Argument : none
- * return : none
- ****************************************************************************************/
- function ufn_setDataChkPopOpen()
- {
- //초기화 처리
- // if(ufn_isNull(iv_sCode)){
- // for(var i=0;i<ds_comCode.rowcount; i++){
- // ds_comCode.setColumn(i,"chk","0");
- // }
-
- edt_comCode.value = null;
- pdp_codeList.edt_comCode.value = "";
-
- var lv_nSelRow;
- if(!utlf_isNull(iv_sCode)){
- lv_aCode = iv_sCode.split(",");
- //var ls_aData = iv_sData;
- iv_sData = "";
- if(lv_aCode.length == 0)
- {
- lv_nSelRow = ds_comCode.findRow(lv_cd,iv_sCode);
- if(lv_nSelRow > -1)
- {
- ds_comCode.setColumn(lv_nSelRow,"chk","1");
- iv_sData = ds_comCode.getColumn(lv_nSelRow,lv_cdNm);
- }
- }
- else
- {
- for(var i=0; i<lv_aCode.length; i++)
- {
- lv_nSelRow = ds_comCode.findRow(lv_cd,lv_aCode[i]);
- if(lv_nSelRow > -1)
- {
- ds_comCode.setColumn(lv_nSelRow,"chk","1");
-
- if(iv_sData.length == 0)
- {
- iv_sData = ds_comCode.getColumn(lv_nSelRow,lv_cdNm);
- }
- else
- {
- iv_sData = iv_sData+","+ds_comCode.getColumn(lv_nSelRow,lv_cdNm);
- }
- }
- }
- }
- }
-
- }
- /****************************************************************************************
- * Description : User Composite popupdiv trackPopup
- * Argument : none
- * return : none
- ****************************************************************************************/
- function fn_popupOpen()
- {
- var nPosX = system.clientToScreenX(edt_comCode, edt_comCode.position.left);
- var nPosY = system.clientToScreenY(edt_comCode, 0);
- pdp_codeList.edt_comCode.value = edt_comCode.value;
- pdp_codeList.position.width = edt_comCode.position.width;
- pdp_codeList.grd_codeList.visible = true;
- pdp_codeList.trackPopup(nPosX,nPosY);
- }
- /****************************************************************************************
- * Description : User Composite edt comCode ontextchanged event
- * Argument : 1.obj : :Edit object
- 2.e : TextChangedEventInfo
- * return :
- ****************************************************************************************/
- function edt_comCode_ontextchanged(obj:Edit, e:TextChangedEventInfo)
- {
- fn_keyTextChk(obj,e);
- iv_nCarePos = obj.getCaretPos();
- if(!iv_sDelMode)
- {
- if(!ufn_isNull(e.posttext) && pdp_codeList.grd_codeList.rowcount > 0){
- fn_popupOpen();
- }
- }
- }
- /****************************************************************************************
- * Description : User Composite pdp_codeList edt_comCode onsetfocus event
- * Argument : 1.obj : :Edit object
- 2.e : TextChangedEventInfo
- * return :
- ****************************************************************************************/
- function pdp_codeList_edt_comCode_onsetfocus(obj:Edit, e:SetFocusEventInfo)
- {
- if(ufn_isNull(obj.value)) pdp_codeList.grd_codeList.visible = false;
- }
- /****************************************************************************************
- * Description : User Composite pdp_codeList onsetfocus event
- * Argument : 1.obj : :PopupDiv object
- 2.e : SetFocusEventInfo
- * return :
- ****************************************************************************************/
- function pdp_codeList_onsetfocus(obj:PopupDiv, e:SetFocusEventInfo)
- {
- if(!ufn_isNull(pdp_codeList.edt_comCode.value))
- {
- pdp_codeList.edt_comCode.setFocus();
- if(!ufn_isNull(iv_nCarePos)) pdp_codeList.edt_comCode.setCaretPos(iv_nCarePos);
- }
- }
- /****************************************************************************************
- * Description : User Composite pdp_codeList edt_comCode ontextchanged event
- * Argument : 1.obj : :Edit object
- 2.e : TextChangedEventInfo
- * return :
- ****************************************************************************************/
- function pdp_codeList_edt_comCode_ontextchanged(obj:Edit, e:TextChangedEventInfo)
- {
- edt_comCode.value = e.posttext;
- if(ufn_getByteLength(e.posttext) == 0)
- {
- pdp_codeList.grd_codeList.visible = false;
- }
- else
- {
- fn_keyTextChk(obj,e);
- pdp_codeList.grd_codeList.visible = true;
- }
- }
- /****************************************************************************************
- * Description : User Composite pdp_codeList oncloseup event
- * Argument : 1.obj : :PopupDiv object
- 2.e : EventInfo
- * return :
- ****************************************************************************************/
- function pdp_codeList_oncloseup(obj:PopupDiv, e:EventInfo)
- {
- ufn_returnDataValue();
-
- fn_setData();
- }
- /****************************************************************************************
- * Description : User Composite pdp_codeList grd_codeList onkeydown event
- * Argument : 1.obj : :Grid object
- 2.e : KeyEventInfo
- * return :
- ****************************************************************************************/
- function pdp_codeList_grd_codeList_onkeydown(obj:Grid, e:KeyEventInfo)
- {
- //엔터키입력시
- if(e.keycode == 13)
- {
- pdp_codeList.closePopup();
- }
-
-
- //방향키 아래로 이동시
- if(e.keycode == 38)
- {
- if(ds_comCode.getSelect(0))
- {
- pdp_codeList.edt_comCode.setFocus();
- }
- }
-
- }
- /****************************************************************************************
- * Description : User Composite pdp_codeList onpopup event
- * Argument : 1.obj : PopupDiv object
- 2.e : EventInfo
- * return :
- ****************************************************************************************/
- function pdp_codeList_onpopup(obj:PopupDiv, e:EventInfo)
- {
- if(!ufn_isNull(iv_nCarePos)) pdp_codeList.edt_comCode.setCaretPos(iv_nCarePos);
- }
- /****************************************************************************************
- * Description : User Composite cp_comCodeChk onsize event
- * Argument : 1.obj : Form object
- 2.e : SizeEventInfo
- * return :
- ****************************************************************************************/
- function cp_comCodeChk_onsize(obj:Form, e:SizeEventInfo)
- {
- fn_setDefault();
- }
- /****************************************************************************************
- * Description : User Composite check Value
- * Argument : 1.obj : Form object
- 2.e : SizeEventInfo
- * return :
- ****************************************************************************************/
- function ufn_returnDataValue()
- {
- if(ds_comCode.rowcount > 0)
- {
- iv_sCode = "";
- iv_sData = "";
- for(var i=0; i<ds_comCode.rowcount; i++)
- {
- if(ds_comCode.getColumn(i,"chk") == "1")
- {
- if(iv_sData.length == 0)
- {
- if(!utlf_isNull(ds_comCode.getColumn(i,lv_cd))){
- iv_sCode = ds_comCode.getColumn(i,lv_cd);
- iv_sData = ds_comCode.getColumn(i,lv_cdNm);
- }
- }
- else
- {
- if(!utlf_isNull(ds_comCode.getColumn(i,lv_cd))){
- iv_sCode = iv_sCode+","+ds_comCode.getColumn(i,lv_cd);
- iv_sData = iv_sData+","+ds_comCode.getColumn(i,lv_cdNm);
- }
- }
- }
- }
- }
- }]]></Script>
- </Form>
- </FDL>
|