cp_comCodeChk.xfdl 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <FDL version="1.5">
  3. <TypeDefinition url="..\default_typedef.xml"/>
  4. <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">
  5. <Layouts>
  6. <Layout>
  7. <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"/>
  8. <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"/>
  9. <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">
  10. <Layouts>
  11. <Layout>
  12. <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">
  13. <Formats>
  14. <Format id="default">
  15. <Columns>
  16. <Column size="20"/>
  17. <Column size="40"/>
  18. <Column size="80"/>
  19. </Columns>
  20. <Rows>
  21. <Row size="24"/>
  22. </Rows>
  23. <Band id="body">
  24. <Cell displaytype="checkbox" edittype="none" text="bind:chk"/>
  25. <Cell col="1" style="align:left middle;" text="bind:cd"/>
  26. <Cell col="2" style="align:left middle;" text="bind:cdNm"/>
  27. </Band>
  28. </Format>
  29. </Formats>
  30. </Grid>
  31. <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"/>
  32. <Button id="btn_dropDown" taborder="1" onclick="fn_showHideList" class="Combo_list_dropbtn" position="absolute 100 1 119 19" positiontype="position"/>
  33. </Layout>
  34. </Layouts>
  35. </PopupDiv>
  36. </Layout>
  37. </Layouts>
  38. <Objects>
  39. <Dataset id="ds_comCode" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false" oncolumnchanged="ds_comCode_oncolumnchanged">
  40. <ColumnInfo>
  41. <Column id="chk" type="STRING" size="256"/>
  42. <Column id="cd" type="STRING" size="256"/>
  43. <Column id="cdNm" type="STRING" size="256"/>
  44. </ColumnInfo>
  45. </Dataset>
  46. </Objects>
  47. <Script type="xscript4.0"><![CDATA[/***************************************************************************************
  48. * System Name : KMTC
  49. * Job Name : Composite
  50. * File Name : cp_comCode.xfdl
  51. * Creator : TOBESOFT
  52. * Make Date : 2013.01.18
  53. *
  54. * Description : multi select combo component
  55. *---------------------------------------------------------------------------------------
  56. * Modify Date Modifier Modify Description
  57. *---------------------------------------------------------------------------------------
  58. * 2013.01.18 TOBESOFT Initial Make Program
  59. *
  60. *---------------------------------------------------------------------------------------
  61. ****************************************************************************************/
  62. //=======================================================================================
  63. // Common Lib Include
  64. //---------------------------------------------------------------------------------------
  65. //include "Lib::xCommon.xjs";
  66. //
  67. //=======================================================================================
  68. // Global Form Variable
  69. //---------------------------------------------------------------------------------------
  70. var iv_aRtn;
  71. var iv_sCode = "";
  72. var iv_sData = "";
  73. var iv_nCdSize = 40;
  74. var iv_nNameSize = 80;
  75. var iv_oDefaultFont = ufn_getObjFont(9,"Tahoma");
  76. var iv_nCarePos;
  77. var iv_sDelMode = false;
  78. var iv_codeGrp;
  79. var iv_event;
  80. var lv_cd;
  81. var lv_cdNm;
  82. var lv_AllChk;
  83. var lv_addItem = 0;
  84. /****************************************************************************************
  85. * Description : Form Initialization
  86. * Argument : obj : Object Event has occurred
  87. * : e : Event Object
  88. * return :
  89. ****************************************************************************************/
  90. function cp_comCodeChk_onload(obj:Form, e:LoadEventInfo)
  91. {
  92. try{
  93. // iv_codeGrp = codeGrp;
  94. }catch(e){}
  95. }
  96. //=======================================================================================
  97. // Event
  98. //---------------------------------------------------------------------------------------
  99. /****************************************************************************************
  100. * Description : dataset oncolumnchanged
  101. * Argument : obj Dataset
  102. e DSColChangeEventInfo
  103. * return : none
  104. ****************************************************************************************/
  105. function ds_comCode_oncolumnchanged(obj:Dataset, e:DSColChangeEventInfo)
  106. {
  107. if(lv_AllChk)
  108. {
  109. if(e.row == 0)
  110. {
  111. ds_comCode.enableevent = false;
  112. if(e.newvalue == "1")
  113. {
  114. for(var i=1; i < ds_comCode.getRowCount(); i++)
  115. {
  116. ds_comCode.setColumn(i, "chk", "1");
  117. }
  118. }
  119. else
  120. {
  121. for(var i=1; i < ds_comCode.getRowCount(); i++)
  122. {
  123. ds_comCode.setColumn(i, "chk", "0");
  124. }
  125. }
  126. ds_comCode.enableevent = true;
  127. ufn_returnDataValue();
  128. }
  129. }
  130. }
  131. //=======================================================================================
  132. // User Function
  133. //---------------------------------------------------------------------------------------
  134. /****************************************************************************************
  135. * Description : Font Object 생성 반환
  136. * Argument : nFontSize 폰트 크기
  137. sFontName 폰트 이름
  138. * return : Font Object
  139. ****************************************************************************************/
  140. function ufn_getObjFont(nFontSize, sFontName)
  141. {
  142. var objFont = new Font;
  143. objFont.size = nFontSize;
  144. objFont.name = sFontName;
  145. objFont.bold = true;
  146. return objFont;
  147. }
  148. /****************************************************************************************
  149. * Description : 1depth 메뉴 Text Size 반환
  150. * Argument : sText (사이즈를 계산할 텍스트 )
  151. * objFont(Font정보를 가지고 있는 object입니다.)
  152. * iLimitWidth (Option : word wrap이 일어나는 문자열 길이 제한 정수 값)
  153. * sConstWordWrapOption (Option : word wrap 옵션입니다)
  154. * return : 계산된 사이즈가 저장된 Size object
  155. ****************************************************************************************/
  156. function ufn_getTextSize(sText, objFont, iLimitWidth, sConstWordWrapOption)
  157. {
  158. var objPainter = this.canvas.getPainter();
  159. if(ufn_isNull(objPainter)==false)
  160. {
  161. var objTextSize = objPainter.getTextSize(sText, objFont);
  162. return objTextSize;
  163. }else
  164. {
  165. return false;
  166. }
  167. }
  168. /****************************************************************************************
  169. * Description : 입력값이 null 또는 wihte space로만 이루어져 있는지 확인 하는 함수
  170. * Argument : value 입력값
  171. * return : boolean. null(혹은 white space) 여부
  172. ****************************************************************************************/
  173. function ufn_isNull(sValue)
  174. {
  175. if (new String(sValue).valueOf() == "undefined") return true;
  176. if (sValue == null) return true;
  177. var lv_sChkStr = new String(sValue);
  178. if (lv_sChkStr == null) return true;
  179. if (lv_sChkStr.toString().length == 0 ) return true;
  180. return false;
  181. }
  182. /****************************************************************************************
  183. * Description : 입력값이 null 또는 wihte space로만 이루어져 있으면 빈문자를 리턴하는 함수
  184. * Argument : sValue String
  185. * return : String
  186. ****************************************************************************************/
  187. function ufn_isEmpty(sValue)
  188. {
  189. if (new String(sValue).valueOf() == "undefined") return "";
  190. if (sValue == null) return "";
  191. var lv_sChkStr = new String(sValue);
  192. if (lv_sChkStr == null) return "";
  193. if (lv_sChkStr.toString().length == 0 ) return "";
  194. return sValue;
  195. }
  196. /****************************************************************************************
  197. * Description : 컴포지트 이벤트 호출 함수
  198. * Argument : sEventId - 호출할 이벤트 ID
  199. * sCompNm - 컴포지트명
  200. * @return N / A
  201. ****************************************************************************************/
  202. function ufn_compositeEvent(sEventId,sCompNm)
  203. {
  204. var lv_oFrame = this.getOwnerFrame();
  205. var lv_bInhForm = ufn_isNull(lv_oFrame.bInhForm) ? false : lv_oFrame.bInhForm;
  206. var lv_bMdiForm = ufn_isNull(lv_oFrame.bMdiForm) ? false : lv_oFrame.bMdiForm;
  207. var lv_bMdiPopForm = ufn_isNull(lv_oFrame.bMdiPopForm) ? false : lv_oFrame.bMdiPopForm;
  208. try{
  209. if(lv_bInhForm)
  210. {
  211. if(lv_bMdiForm == true || lv_bMdiPopForm == true)
  212. {
  213. if(ufn_isNull(sCompNm))
  214. {
  215. eval("this.getOwnerFrame().form.div_Layout.div_Work."+sEventId+"()");
  216. }
  217. else
  218. {
  219. eval("this.getOwnerFrame().form.div_Layout.div_Work."+sEventId+"('"+sCompNm+"')");
  220. }
  221. }
  222. else
  223. {
  224. if(ufn_isNull(sCompNm))
  225. {
  226. eval("this.getOwnerFrame().form."+sEventId+"()");
  227. }
  228. else
  229. { ;
  230. eval("this.getOwnerFrame().form."+sEventId+"('"+sCompNm+"')");
  231. }
  232. }
  233. }
  234. else
  235. {
  236. if(ufn_isNull(sCompNm))
  237. {
  238. eval(sEventId+"()");
  239. }
  240. else
  241. {
  242. eval(sEventId+"('"+sCompNm+"')");
  243. }
  244. }
  245. }catch(err){}
  246. }
  247. /****************************************************************************************
  248. * Description : User Composite Get Data Method
  249. * Argument : none
  250. * return : array
  251. ****************************************************************************************/
  252. function getData()
  253. {
  254. iv_aRtn = new Array(2);
  255. iv_aRtn[0] = ufn_isEmpty(iv_sCode);
  256. iv_aRtn[1] = ufn_isEmpty(iv_sData);
  257. return iv_aRtn;
  258. }
  259. /****************************************************************************************
  260. * Description : User Composite Set Data Method
  261. * Argument : value
  262. * return : none
  263. ****************************************************************************************/
  264. function setData(sData)
  265. {
  266. if(!ufn_isNull(sData))
  267. {
  268. iv_sCode = sData;
  269. // trace("adfasd :: "+iv_sCode);
  270. ufn_setDataChk(sData);
  271. }else{
  272. iv_sCode = "";
  273. iv_sData = "";
  274. ufn_setDataChk();
  275. fn_setData();
  276. }
  277. }
  278. /****************************************************************************************
  279. * Description : User Composite chkeck value
  280. * Argument : none
  281. * return : none
  282. ****************************************************************************************/
  283. function ufn_setDataChk(sData)
  284. {
  285. //초기화 처리
  286. // if(ufn_isNull(iv_sCode)){
  287. for(var i=0;i<ds_comCode.rowcount; i++){
  288. ds_comCode.setColumn(i,"chk","0");
  289. }
  290. iv_sCode = sData;
  291. edt_comCode.value = null;
  292. pdp_codeList.edt_comCode.value = "";
  293. var lv_nSelRow;
  294. if(!utlf_isNull(iv_sCode)){
  295. lv_aCode = iv_sCode.split(",");
  296. iv_sData = "";
  297. if(lv_aCode.length == 0)
  298. {
  299. lv_nSelRow = ds_comCode.findRow(lv_cd,iv_sCode);
  300. if(lv_nSelRow > -1)
  301. {
  302. ds_comCode.setColumn(lv_nSelRow,"chk","1");
  303. iv_sData = ds_comCode.getColumn(lv_nSelRow,lv_cdNm);
  304. }
  305. }
  306. else
  307. {
  308. for(var i=0; i<lv_aCode.length; i++)
  309. {
  310. lv_nSelRow = ds_comCode.findRow(lv_cd,lv_aCode[i]);
  311. if(lv_nSelRow > -1)
  312. {
  313. ds_comCode.setColumn(lv_nSelRow,"chk","1");
  314. if(iv_sData.length == 0)
  315. {
  316. iv_sData = ds_comCode.getColumn(lv_nSelRow,lv_cdNm);
  317. }
  318. else
  319. {
  320. iv_sData = iv_sData+","+ds_comCode.getColumn(lv_nSelRow,lv_cdNm);
  321. }
  322. }
  323. }
  324. }
  325. fn_setData();
  326. }
  327. }
  328. /****************************************************************************************
  329. * Description : User Composite data setting
  330. * Argument : none
  331. * return : none
  332. ****************************************************************************************/
  333. function fn_setData()
  334. {
  335. edt_comCode.value = iv_sData;
  336. if(!ufn_isNull(iv_event)) ufn_compositeEvent(iv_event,this.name);
  337. }
  338. /****************************************************************************************
  339. * Description : User Composite Set Call event
  340. * Argument : sEvent string
  341. * return : none
  342. ****************************************************************************************/
  343. function setCallEvent(sEvent)
  344. {
  345. iv_event = sEvent;
  346. }
  347. /****************************************************************************************
  348. * Description : User Composite 컴포지트 필수 표시 함수 입력값은 : true / false
  349. * Argument : bReq true/false
  350. * return : none
  351. ****************************************************************************************/
  352. function setRequestment(bReq)
  353. {
  354. if(bReq)
  355. {
  356. edt_comCode.class = "ComboList_essential";
  357. pdp_codeList.edt_comCode.class = "ComboList_essential";
  358. }
  359. else
  360. {
  361. edt_comCode.class = "ComboList";
  362. pdp_codeList.edt_comCode.class = "ComboList";
  363. }
  364. }
  365. /****************************************************************************************
  366. * Description : User Composite enable setting
  367. * Argument : bReq true/false
  368. * return : none
  369. ****************************************************************************************/
  370. function setEnbale(bReq)
  371. {
  372. btn_dropDown.enable = bReq;
  373. edt_comCode.enable = bReq;
  374. }
  375. /****************************************************************************************
  376. * Description : User Composite dataset bind
  377. * Argument : oDataset dataset Object
  378. sCode code column string
  379. sCodeName data column string
  380. * return : none
  381. ****************************************************************************************/
  382. function setBindDataset(oDataset, sCode, sCodeName)
  383. {
  384. if((!ufn_isNull(oDataset) && oDataset.rowcount > 0) && !ufn_isNull(sCode) && !ufn_isNull(sCodeName) )
  385. {
  386. lv_cd = sCode; //code 컬럼 아이디
  387. lv_cdNm = sCodeName; //data 컬럼 아이디
  388. ds_comCode.clearData();
  389. ds_comCode.copyData(oDataset,true);
  390. pdp_codeList.grd_codeList.setCellProperty("Body", 1, "text", "bind:"+sCode);
  391. pdp_codeList.grd_codeList.setCellProperty("Body", 2, "text", "bind:"+sCodeName);
  392. ds_comCode.addColumn("chk","String");
  393. fn_setDefault();
  394. }
  395. }
  396. /****************************************************************************************
  397. * Description : User Composite Combo Item Add
  398. * Argument : sCode - String codedata
  399. sData - String name data
  400. sOpt - String insert or append ("top" : insertRow, addRow())
  401. bAllChk - All Check true/false
  402. * return : none
  403. ****************************************************************************************/
  404. function setAddItem(sCode, sData, sOpt, bAllChk)
  405. {
  406. if(lv_addItem == 0){
  407. if(bAllChk == "Y" || sOpt == "top")
  408. {
  409. ds_comCode.insertRow(0);
  410. ds_comCode.setColumn(0, lv_cd , sCode);
  411. ds_comCode.setColumn(0, lv_cdNm , sData);
  412. }
  413. else
  414. {
  415. var nRow = ds_comCode.addRow();
  416. ds_comCode.setColumn(nRow, lv_cd , sCode);
  417. ds_comCode.setColumn(nRow, lv_cdNm , sData);
  418. }
  419. lv_addItem++;
  420. }
  421. //전체 체크여부
  422. if(bAllChk == true || bAllChk == false)
  423. {
  424. lv_AllChk = bAllChk;
  425. if(bAllChk == true ){
  426. ds_comCode.enableevent = false;
  427. for(var i=0; i < ds_comCode.getRowCount(); i++)
  428. {
  429. ds_comCode.setColumn(i, "chk", "1");
  430. }
  431. ds_comCode.enableevent = true;
  432. }else{
  433. ds_comCode.enableevent = false;
  434. for(var i=0; i < ds_comCode.getRowCount(); i++)
  435. {
  436. ds_comCode.setColumn(i, "chk", "0");
  437. }
  438. ds_comCode.enableevent = true;
  439. }
  440. ufn_returnDataValue();
  441. fn_setData();
  442. }
  443. }
  444. /****************************************************************************************
  445. * Description : User Composite Combo Item Delete
  446. * Argument : sCode - String codedata
  447. bAllChk - All Check true/false
  448. * return : none
  449. ****************************************************************************************/
  450. function setRemoveItem(sCode, bAllChk)
  451. {
  452. var nRow = ds_comCode.findRow(lv_cd,sCode);
  453. if(nRow > -1)
  454. {
  455. ds_comCode.deleteRow(nRow);
  456. }
  457. ufn_returnDataValue();
  458. //전체 체크여부
  459. if(bAllChk)
  460. {
  461. lv_AllChk = bAllChk;
  462. }
  463. }
  464. /****************************************************************************************
  465. * Description : User Composite default setting
  466. * Argument : none
  467. * return : none
  468. ****************************************************************************************/
  469. function fn_setDefault()
  470. {
  471. pdp_codeList.position.width = edt_comCode.position.width;
  472. pdp_codeList.edt_comCode.position.width = this.position.width;
  473. // pdp_codeList.btn_dropDown.position.right = this.position.width;
  474. // pdp_codeList.btn_dropDown.position.left = pdp_codeList.btn_dropDown.position.right - 18;
  475. pdp_codeList.btn_dropDown.position.x = pdp_codeList.position.width - 19;
  476. var lv_nDrSize = this.position.width;
  477. var lv_oCdSize;
  478. var lv_oCdNmSize;
  479. for(var i=0; i<ds_comCode.rowcount; i++)
  480. {
  481. lv_oCdSize = ufn_getTextSize(ds_comCode.getColumn(i, lv_cd ),iv_oDefaultFont);
  482. lv_oCdNmSize = ufn_getTextSize(ds_comCode.getColumn(i, lv_cdNm),iv_oDefaultFont);
  483. if(lv_oCdSize.cx+20 > iv_nCdSize)
  484. {
  485. iv_nCdSize = lv_oCdSize.cx+20;
  486. }
  487. if(lv_oCdNmSize.cx+20 > iv_nNameSize)
  488. {
  489. iv_nNameSize = lv_oCdNmSize.cx+20;
  490. }
  491. }
  492. if(this.novisiblecodeYn == "Y") {
  493. pdp_codeList.grd_codeList.setFormatColProperty(1, "size", 0);
  494. } else {
  495. if(iv_nCdSize > 40)
  496. {
  497. pdp_codeList.grd_codeList.setFormatColProperty(1,"size",iv_nCdSize);
  498. }
  499. }
  500. if(iv_nNameSize > 80)
  501. {
  502. pdp_codeList.grd_codeList.setFormatColProperty(2,"size",iv_nNameSize);
  503. }
  504. if(lv_nDrSize < (iv_nCdSize+iv_nNameSize))
  505. {
  506. lv_nDrSize = iv_nCdSize+iv_nNameSize;
  507. }
  508. else
  509. {
  510. iv_nNameSize = lv_nDrSize - pdp_codeList.grd_codeList.getFormatColProperty(0,"size")- iv_nCdSize;
  511. pdp_codeList.grd_codeList.setFormatColProperty(2,"size",iv_nNameSize);
  512. }
  513. pdp_codeList.position.width = lv_nDrSize;
  514. ds_comCode.selectRow(0);
  515. }
  516. /****************************************************************************************
  517. * Description : User Composite popupdiv close
  518. * Argument : none
  519. * return : none
  520. ****************************************************************************************/
  521. function fn_showHideList()
  522. {
  523. pdp_codeList.closePopup();
  524. }
  525. /****************************************************************************************
  526. * Description : User Composite key text check - 데이터셋 코드 필터
  527. * Argument : none
  528. * return : none
  529. ****************************************************************************************/
  530. function fn_keyTextChk(obj,e)
  531. {
  532. ds_comCode.filter("");
  533. var lv_sCode = obj.value;
  534. if(!ufn_isNull(lv_sCode))
  535. {
  536. if(gfn_isCodeChar(lv_sCode))
  537. {
  538. ds_comCode.filter("cd.toString().indexOf('"+lv_sCode+"') == 0");
  539. }
  540. }
  541. ds_comCode.selectRow(0);
  542. }
  543. /****************************************************************************************
  544. * Description : User Composite key event
  545. * Argument : none
  546. * return : none
  547. ****************************************************************************************/
  548. function fn_keyDown(obj,e)
  549. {
  550. iv_sDelMode = false;
  551. //엔터키입력시
  552. if(e.keycode == 13)
  553. {
  554. if(!pdp_codeList.isPopup())
  555. {
  556. var sCompNm = this.name;
  557. if(sCompNm.indexOf("_S") > -1)
  558. {
  559. ufn_compositeEvent("ufn_search","");
  560. }
  561. }
  562. else
  563. {
  564. if(pdp_codeList.grd_codeList.rowcount > 0)
  565. {
  566. iv_sCode = "";
  567. iv_sData = "";
  568. for(var i=0; i<pdp_codeList.grd_codeList.rowcount; i++)
  569. {
  570. if(ds_comCode.getColumn(i,"chk") == "1")
  571. {
  572. if(iv_sCode.length == 0)
  573. {
  574. iv_sCode = ds_comCode.getColumn(i,lv_cd);
  575. iv_sData = ds_comCode.getColumn(i,lv_cdNm);
  576. }
  577. else
  578. {
  579. iv_sCode += ","+ds_comCode.getColumn(i,lv_cd);
  580. iv_sData += ","+ds_comCode.getColumn(i,lv_cdNm);
  581. }
  582. }
  583. }
  584. fn_setData();
  585. pdp_codeList.closePopup();
  586. }
  587. }
  588. }
  589. /*
  590. //엔터키입력시
  591. if(e.keycode == 9)
  592. {
  593. pdp_codeList.closePopup();
  594. }
  595. //방향키 아래로 이동시
  596. if(e.keycode == 40)
  597. {
  598. pdp_codeList.grd_codeList.setFocus();
  599. }
  600. if(e.keycode == 8 || e.keycode == 46)
  601. {
  602. iv_sDelMode = true;
  603. iv_sCode = "";
  604. iv_sData = "";
  605. }
  606. */
  607. }
  608. /****************************************************************************************
  609. * Description : User Composite Set Check event
  610. * Argument : 1.obj : grid object
  611. 2.e : GridClickEventInfo
  612. * return :
  613. ****************************************************************************************/
  614. function pdp_codeList_grd_codeList_oncellclick(obj:Grid, e:GridClickEventInfo)
  615. {
  616. if(ds_comCode.getColumn(e.row,"chk") == "1")
  617. {
  618. ds_comCode.setColumn(e.row,"chk","0");
  619. }
  620. else
  621. {
  622. ds_comCode.setColumn(e.row,"chk","1");
  623. }
  624. }
  625. /****************************************************************************************
  626. * Description : User Composite down Button Click
  627. * Argument : 1.obj : Button object
  628. 2.e : ClickEventInfo
  629. * return :
  630. ****************************************************************************************/
  631. function btn_dropDown_onclick(obj:Button, e:ClickEventInfo)
  632. {
  633. ds_comCode.filter("");
  634. ufn_setDataChkPopOpen();
  635. fn_popupOpen();
  636. }
  637. /****************************************************************************************
  638. * Description : User Composite chkeck value
  639. * Argument : none
  640. * return : none
  641. ****************************************************************************************/
  642. function ufn_setDataChkPopOpen()
  643. {
  644. //초기화 처리
  645. // if(ufn_isNull(iv_sCode)){
  646. // for(var i=0;i<ds_comCode.rowcount; i++){
  647. // ds_comCode.setColumn(i,"chk","0");
  648. // }
  649. edt_comCode.value = null;
  650. pdp_codeList.edt_comCode.value = "";
  651. var lv_nSelRow;
  652. if(!utlf_isNull(iv_sCode)){
  653. lv_aCode = iv_sCode.split(",");
  654. //var ls_aData = iv_sData;
  655. iv_sData = "";
  656. if(lv_aCode.length == 0)
  657. {
  658. lv_nSelRow = ds_comCode.findRow(lv_cd,iv_sCode);
  659. if(lv_nSelRow > -1)
  660. {
  661. ds_comCode.setColumn(lv_nSelRow,"chk","1");
  662. iv_sData = ds_comCode.getColumn(lv_nSelRow,lv_cdNm);
  663. }
  664. }
  665. else
  666. {
  667. for(var i=0; i<lv_aCode.length; i++)
  668. {
  669. lv_nSelRow = ds_comCode.findRow(lv_cd,lv_aCode[i]);
  670. if(lv_nSelRow > -1)
  671. {
  672. ds_comCode.setColumn(lv_nSelRow,"chk","1");
  673. if(iv_sData.length == 0)
  674. {
  675. iv_sData = ds_comCode.getColumn(lv_nSelRow,lv_cdNm);
  676. }
  677. else
  678. {
  679. iv_sData = iv_sData+","+ds_comCode.getColumn(lv_nSelRow,lv_cdNm);
  680. }
  681. }
  682. }
  683. }
  684. }
  685. }
  686. /****************************************************************************************
  687. * Description : User Composite popupdiv trackPopup
  688. * Argument : none
  689. * return : none
  690. ****************************************************************************************/
  691. function fn_popupOpen()
  692. {
  693. var nPosX = system.clientToScreenX(edt_comCode, edt_comCode.position.left);
  694. var nPosY = system.clientToScreenY(edt_comCode, 0);
  695. pdp_codeList.edt_comCode.value = edt_comCode.value;
  696. pdp_codeList.position.width = edt_comCode.position.width;
  697. pdp_codeList.grd_codeList.visible = true;
  698. pdp_codeList.trackPopup(nPosX,nPosY);
  699. }
  700. /****************************************************************************************
  701. * Description : User Composite edt comCode ontextchanged event
  702. * Argument : 1.obj : :Edit object
  703. 2.e : TextChangedEventInfo
  704. * return :
  705. ****************************************************************************************/
  706. function edt_comCode_ontextchanged(obj:Edit, e:TextChangedEventInfo)
  707. {
  708. fn_keyTextChk(obj,e);
  709. iv_nCarePos = obj.getCaretPos();
  710. if(!iv_sDelMode)
  711. {
  712. if(!ufn_isNull(e.posttext) && pdp_codeList.grd_codeList.rowcount > 0){
  713. fn_popupOpen();
  714. }
  715. }
  716. }
  717. /****************************************************************************************
  718. * Description : User Composite pdp_codeList edt_comCode onsetfocus event
  719. * Argument : 1.obj : :Edit object
  720. 2.e : TextChangedEventInfo
  721. * return :
  722. ****************************************************************************************/
  723. function pdp_codeList_edt_comCode_onsetfocus(obj:Edit, e:SetFocusEventInfo)
  724. {
  725. if(ufn_isNull(obj.value)) pdp_codeList.grd_codeList.visible = false;
  726. }
  727. /****************************************************************************************
  728. * Description : User Composite pdp_codeList onsetfocus event
  729. * Argument : 1.obj : :PopupDiv object
  730. 2.e : SetFocusEventInfo
  731. * return :
  732. ****************************************************************************************/
  733. function pdp_codeList_onsetfocus(obj:PopupDiv, e:SetFocusEventInfo)
  734. {
  735. if(!ufn_isNull(pdp_codeList.edt_comCode.value))
  736. {
  737. pdp_codeList.edt_comCode.setFocus();
  738. if(!ufn_isNull(iv_nCarePos)) pdp_codeList.edt_comCode.setCaretPos(iv_nCarePos);
  739. }
  740. }
  741. /****************************************************************************************
  742. * Description : User Composite pdp_codeList edt_comCode ontextchanged event
  743. * Argument : 1.obj : :Edit object
  744. 2.e : TextChangedEventInfo
  745. * return :
  746. ****************************************************************************************/
  747. function pdp_codeList_edt_comCode_ontextchanged(obj:Edit, e:TextChangedEventInfo)
  748. {
  749. edt_comCode.value = e.posttext;
  750. if(ufn_getByteLength(e.posttext) == 0)
  751. {
  752. pdp_codeList.grd_codeList.visible = false;
  753. }
  754. else
  755. {
  756. fn_keyTextChk(obj,e);
  757. pdp_codeList.grd_codeList.visible = true;
  758. }
  759. }
  760. /****************************************************************************************
  761. * Description : User Composite pdp_codeList oncloseup event
  762. * Argument : 1.obj : :PopupDiv object
  763. 2.e : EventInfo
  764. * return :
  765. ****************************************************************************************/
  766. function pdp_codeList_oncloseup(obj:PopupDiv, e:EventInfo)
  767. {
  768. ufn_returnDataValue();
  769. fn_setData();
  770. }
  771. /****************************************************************************************
  772. * Description : User Composite pdp_codeList grd_codeList onkeydown event
  773. * Argument : 1.obj : :Grid object
  774. 2.e : KeyEventInfo
  775. * return :
  776. ****************************************************************************************/
  777. function pdp_codeList_grd_codeList_onkeydown(obj:Grid, e:KeyEventInfo)
  778. {
  779. //엔터키입력시
  780. if(e.keycode == 13)
  781. {
  782. pdp_codeList.closePopup();
  783. }
  784. //방향키 아래로 이동시
  785. if(e.keycode == 38)
  786. {
  787. if(ds_comCode.getSelect(0))
  788. {
  789. pdp_codeList.edt_comCode.setFocus();
  790. }
  791. }
  792. }
  793. /****************************************************************************************
  794. * Description : User Composite pdp_codeList onpopup event
  795. * Argument : 1.obj : PopupDiv object
  796. 2.e : EventInfo
  797. * return :
  798. ****************************************************************************************/
  799. function pdp_codeList_onpopup(obj:PopupDiv, e:EventInfo)
  800. {
  801. if(!ufn_isNull(iv_nCarePos)) pdp_codeList.edt_comCode.setCaretPos(iv_nCarePos);
  802. }
  803. /****************************************************************************************
  804. * Description : User Composite cp_comCodeChk onsize event
  805. * Argument : 1.obj : Form object
  806. 2.e : SizeEventInfo
  807. * return :
  808. ****************************************************************************************/
  809. function cp_comCodeChk_onsize(obj:Form, e:SizeEventInfo)
  810. {
  811. fn_setDefault();
  812. }
  813. /****************************************************************************************
  814. * Description : User Composite check Value
  815. * Argument : 1.obj : Form object
  816. 2.e : SizeEventInfo
  817. * return :
  818. ****************************************************************************************/
  819. function ufn_returnDataValue()
  820. {
  821. if(ds_comCode.rowcount > 0)
  822. {
  823. iv_sCode = "";
  824. iv_sData = "";
  825. for(var i=0; i<ds_comCode.rowcount; i++)
  826. {
  827. if(ds_comCode.getColumn(i,"chk") == "1")
  828. {
  829. if(iv_sData.length == 0)
  830. {
  831. if(!utlf_isNull(ds_comCode.getColumn(i,lv_cd))){
  832. iv_sCode = ds_comCode.getColumn(i,lv_cd);
  833. iv_sData = ds_comCode.getColumn(i,lv_cdNm);
  834. }
  835. }
  836. else
  837. {
  838. if(!utlf_isNull(ds_comCode.getColumn(i,lv_cd))){
  839. iv_sCode = iv_sCode+","+ds_comCode.getColumn(i,lv_cd);
  840. iv_sData = iv_sData+","+ds_comCode.getColumn(i,lv_cdNm);
  841. }
  842. }
  843. }
  844. }
  845. }
  846. }]]></Script>
  847. </Form>
  848. </FDL>