cp_comCodeChk.xfdl 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <FDL version="1.4">
  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(iv_nCdSize > 40)
  493. {
  494. pdp_codeList.grd_codeList.setFormatColProperty(1,"size",iv_nCdSize);
  495. }
  496. if(iv_nNameSize > 80)
  497. {
  498. pdp_codeList.grd_codeList.setFormatColProperty(2,"size",iv_nNameSize);
  499. }
  500. if(lv_nDrSize < (iv_nCdSize+iv_nNameSize))
  501. {
  502. lv_nDrSize = iv_nCdSize+iv_nNameSize;
  503. }
  504. else
  505. {
  506. iv_nNameSize = lv_nDrSize - pdp_codeList.grd_codeList.getFormatColProperty(0,"size")- iv_nCdSize;
  507. pdp_codeList.grd_codeList.setFormatColProperty(2,"size",iv_nNameSize);
  508. }
  509. pdp_codeList.position.width = lv_nDrSize;
  510. ds_comCode.selectRow(0);
  511. }
  512. /****************************************************************************************
  513. * Description : User Composite popupdiv close
  514. * Argument : none
  515. * return : none
  516. ****************************************************************************************/
  517. function fn_showHideList()
  518. {
  519. pdp_codeList.closePopup();
  520. }
  521. /****************************************************************************************
  522. * Description : User Composite key text check - 데이터셋 코드 필터
  523. * Argument : none
  524. * return : none
  525. ****************************************************************************************/
  526. function fn_keyTextChk(obj,e)
  527. {
  528. ds_comCode.filter("");
  529. var lv_sCode = obj.value;
  530. if(!ufn_isNull(lv_sCode))
  531. {
  532. if(gfn_isCodeChar(lv_sCode))
  533. {
  534. ds_comCode.filter("cd.toString().indexOf('"+lv_sCode+"') == 0");
  535. }
  536. }
  537. ds_comCode.selectRow(0);
  538. }
  539. /****************************************************************************************
  540. * Description : User Composite key event
  541. * Argument : none
  542. * return : none
  543. ****************************************************************************************/
  544. function fn_keyDown(obj,e)
  545. {
  546. iv_sDelMode = false;
  547. //엔터키입력시
  548. if(e.keycode == 13)
  549. {
  550. if(!pdp_codeList.isPopup())
  551. {
  552. var sCompNm = this.name;
  553. if(sCompNm.indexOf("_S") > -1)
  554. {
  555. ufn_compositeEvent("ufn_search","");
  556. }
  557. }
  558. else
  559. {
  560. if(pdp_codeList.grd_codeList.rowcount > 0)
  561. {
  562. iv_sCode = "";
  563. iv_sData = "";
  564. for(var i=0; i<pdp_codeList.grd_codeList.rowcount; i++)
  565. {
  566. if(ds_comCode.getColumn(i,"chk") == "1")
  567. {
  568. if(iv_sCode.length == 0)
  569. {
  570. iv_sCode = ds_comCode.getColumn(i,lv_cd);
  571. iv_sData = ds_comCode.getColumn(i,lv_cdNm);
  572. }
  573. else
  574. {
  575. iv_sCode += ","+ds_comCode.getColumn(i,lv_cd);
  576. iv_sData += ","+ds_comCode.getColumn(i,lv_cdNm);
  577. }
  578. }
  579. }
  580. fn_setData();
  581. pdp_codeList.closePopup();
  582. }
  583. }
  584. }
  585. /*
  586. //엔터키입력시
  587. if(e.keycode == 9)
  588. {
  589. pdp_codeList.closePopup();
  590. }
  591. //방향키 아래로 이동시
  592. if(e.keycode == 40)
  593. {
  594. pdp_codeList.grd_codeList.setFocus();
  595. }
  596. if(e.keycode == 8 || e.keycode == 46)
  597. {
  598. iv_sDelMode = true;
  599. iv_sCode = "";
  600. iv_sData = "";
  601. }
  602. */
  603. }
  604. /****************************************************************************************
  605. * Description : User Composite Set Check event
  606. * Argument : 1.obj : grid object
  607. 2.e : GridClickEventInfo
  608. * return :
  609. ****************************************************************************************/
  610. function pdp_codeList_grd_codeList_oncellclick(obj:Grid, e:GridClickEventInfo)
  611. {
  612. if(ds_comCode.getColumn(e.row,"chk") == "1")
  613. {
  614. ds_comCode.setColumn(e.row,"chk","0");
  615. }
  616. else
  617. {
  618. ds_comCode.setColumn(e.row,"chk","1");
  619. }
  620. }
  621. /****************************************************************************************
  622. * Description : User Composite down Button Click
  623. * Argument : 1.obj : Button object
  624. 2.e : ClickEventInfo
  625. * return :
  626. ****************************************************************************************/
  627. function btn_dropDown_onclick(obj:Button, e:ClickEventInfo)
  628. {
  629. ds_comCode.filter("");
  630. ufn_setDataChkPopOpen();
  631. fn_popupOpen();
  632. }
  633. /****************************************************************************************
  634. * Description : User Composite chkeck value
  635. * Argument : none
  636. * return : none
  637. ****************************************************************************************/
  638. function ufn_setDataChkPopOpen()
  639. {
  640. //초기화 처리
  641. // if(ufn_isNull(iv_sCode)){
  642. // for(var i=0;i<ds_comCode.rowcount; i++){
  643. // ds_comCode.setColumn(i,"chk","0");
  644. // }
  645. edt_comCode.value = null;
  646. pdp_codeList.edt_comCode.value = "";
  647. var lv_nSelRow;
  648. if(!utlf_isNull(iv_sCode)){
  649. lv_aCode = iv_sCode.split(",");
  650. //var ls_aData = iv_sData;
  651. iv_sData = "";
  652. if(lv_aCode.length == 0)
  653. {
  654. lv_nSelRow = ds_comCode.findRow(lv_cd,iv_sCode);
  655. if(lv_nSelRow > -1)
  656. {
  657. ds_comCode.setColumn(lv_nSelRow,"chk","1");
  658. iv_sData = ds_comCode.getColumn(lv_nSelRow,lv_cdNm);
  659. }
  660. }
  661. else
  662. {
  663. for(var i=0; i<lv_aCode.length; i++)
  664. {
  665. lv_nSelRow = ds_comCode.findRow(lv_cd,lv_aCode[i]);
  666. if(lv_nSelRow > -1)
  667. {
  668. ds_comCode.setColumn(lv_nSelRow,"chk","1");
  669. if(iv_sData.length == 0)
  670. {
  671. iv_sData = ds_comCode.getColumn(lv_nSelRow,lv_cdNm);
  672. }
  673. else
  674. {
  675. iv_sData = iv_sData+","+ds_comCode.getColumn(lv_nSelRow,lv_cdNm);
  676. }
  677. }
  678. }
  679. }
  680. }
  681. }
  682. /****************************************************************************************
  683. * Description : User Composite popupdiv trackPopup
  684. * Argument : none
  685. * return : none
  686. ****************************************************************************************/
  687. function fn_popupOpen()
  688. {
  689. var nPosX = system.clientToScreenX(edt_comCode, edt_comCode.position.left);
  690. var nPosY = system.clientToScreenY(edt_comCode, 0);
  691. pdp_codeList.edt_comCode.value = edt_comCode.value;
  692. pdp_codeList.position.width = edt_comCode.position.width;
  693. pdp_codeList.grd_codeList.visible = true;
  694. pdp_codeList.trackPopup(nPosX,nPosY);
  695. }
  696. /****************************************************************************************
  697. * Description : User Composite edt comCode ontextchanged event
  698. * Argument : 1.obj : :Edit object
  699. 2.e : TextChangedEventInfo
  700. * return :
  701. ****************************************************************************************/
  702. function edt_comCode_ontextchanged(obj:Edit, e:TextChangedEventInfo)
  703. {
  704. fn_keyTextChk(obj,e);
  705. iv_nCarePos = obj.getCaretPos();
  706. if(!iv_sDelMode)
  707. {
  708. if(!ufn_isNull(e.posttext) && pdp_codeList.grd_codeList.rowcount > 0){
  709. fn_popupOpen();
  710. }
  711. }
  712. }
  713. /****************************************************************************************
  714. * Description : User Composite pdp_codeList edt_comCode onsetfocus event
  715. * Argument : 1.obj : :Edit object
  716. 2.e : TextChangedEventInfo
  717. * return :
  718. ****************************************************************************************/
  719. function pdp_codeList_edt_comCode_onsetfocus(obj:Edit, e:SetFocusEventInfo)
  720. {
  721. if(ufn_isNull(obj.value)) pdp_codeList.grd_codeList.visible = false;
  722. }
  723. /****************************************************************************************
  724. * Description : User Composite pdp_codeList onsetfocus event
  725. * Argument : 1.obj : :PopupDiv object
  726. 2.e : SetFocusEventInfo
  727. * return :
  728. ****************************************************************************************/
  729. function pdp_codeList_onsetfocus(obj:PopupDiv, e:SetFocusEventInfo)
  730. {
  731. if(!ufn_isNull(pdp_codeList.edt_comCode.value))
  732. {
  733. pdp_codeList.edt_comCode.setFocus();
  734. if(!ufn_isNull(iv_nCarePos)) pdp_codeList.edt_comCode.setCaretPos(iv_nCarePos);
  735. }
  736. }
  737. /****************************************************************************************
  738. * Description : User Composite pdp_codeList edt_comCode ontextchanged event
  739. * Argument : 1.obj : :Edit object
  740. 2.e : TextChangedEventInfo
  741. * return :
  742. ****************************************************************************************/
  743. function pdp_codeList_edt_comCode_ontextchanged(obj:Edit, e:TextChangedEventInfo)
  744. {
  745. edt_comCode.value = e.posttext;
  746. if(ufn_getByteLength(e.posttext) == 0)
  747. {
  748. pdp_codeList.grd_codeList.visible = false;
  749. }
  750. else
  751. {
  752. fn_keyTextChk(obj,e);
  753. pdp_codeList.grd_codeList.visible = true;
  754. }
  755. }
  756. /****************************************************************************************
  757. * Description : User Composite pdp_codeList oncloseup event
  758. * Argument : 1.obj : :PopupDiv object
  759. 2.e : EventInfo
  760. * return :
  761. ****************************************************************************************/
  762. function pdp_codeList_oncloseup(obj:PopupDiv, e:EventInfo)
  763. {
  764. ufn_returnDataValue();
  765. fn_setData();
  766. }
  767. /****************************************************************************************
  768. * Description : User Composite pdp_codeList grd_codeList onkeydown event
  769. * Argument : 1.obj : :Grid object
  770. 2.e : KeyEventInfo
  771. * return :
  772. ****************************************************************************************/
  773. function pdp_codeList_grd_codeList_onkeydown(obj:Grid, e:KeyEventInfo)
  774. {
  775. //엔터키입력시
  776. if(e.keycode == 13)
  777. {
  778. pdp_codeList.closePopup();
  779. }
  780. //방향키 아래로 이동시
  781. if(e.keycode == 38)
  782. {
  783. if(ds_comCode.getSelect(0))
  784. {
  785. pdp_codeList.edt_comCode.setFocus();
  786. }
  787. }
  788. }
  789. /****************************************************************************************
  790. * Description : User Composite pdp_codeList onpopup event
  791. * Argument : 1.obj : PopupDiv object
  792. 2.e : EventInfo
  793. * return :
  794. ****************************************************************************************/
  795. function pdp_codeList_onpopup(obj:PopupDiv, e:EventInfo)
  796. {
  797. if(!ufn_isNull(iv_nCarePos)) pdp_codeList.edt_comCode.setCaretPos(iv_nCarePos);
  798. }
  799. /****************************************************************************************
  800. * Description : User Composite cp_comCodeChk onsize event
  801. * Argument : 1.obj : Form object
  802. 2.e : SizeEventInfo
  803. * return :
  804. ****************************************************************************************/
  805. function cp_comCodeChk_onsize(obj:Form, e:SizeEventInfo)
  806. {
  807. fn_setDefault();
  808. }
  809. /****************************************************************************************
  810. * Description : User Composite check Value
  811. * Argument : 1.obj : Form object
  812. 2.e : SizeEventInfo
  813. * return :
  814. ****************************************************************************************/
  815. function ufn_returnDataValue()
  816. {
  817. if(ds_comCode.rowcount > 0)
  818. {
  819. iv_sCode = "";
  820. iv_sData = "";
  821. for(var i=0; i<ds_comCode.rowcount; i++)
  822. {
  823. if(ds_comCode.getColumn(i,"chk") == "1")
  824. {
  825. if(iv_sData.length == 0)
  826. {
  827. if(!utlf_isNull(ds_comCode.getColumn(i,lv_cd))){
  828. iv_sCode = ds_comCode.getColumn(i,lv_cd);
  829. iv_sData = ds_comCode.getColumn(i,lv_cdNm);
  830. }
  831. }
  832. else
  833. {
  834. if(!utlf_isNull(ds_comCode.getColumn(i,lv_cd))){
  835. iv_sCode = iv_sCode+","+ds_comCode.getColumn(i,lv_cd);
  836. iv_sData = iv_sData+","+ds_comCode.getColumn(i,lv_cdNm);
  837. }
  838. }
  839. }
  840. }
  841. }
  842. }]]></Script>
  843. </Form>
  844. </FDL>