123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515 |
- <?xml version="1.0" encoding="utf-8"?>
- <FDL version="1.5">
- <TypeDefinition url="..\..\..\default_typedef.xml"/>
- <Form id="SSZFM00401_DataSetRtrv" classname="SSZFM00401_DataSetRtrv" inheritanceid="" position="absolute 0 0 900 383" titletext="DataSet 미리보기" onload="SSZFM00401_DataSetRtrv_onload" style="color:#444444ff;" scrollbars="autohorz" onkeydown="SSZFM00401_DataSetRtrv_onkeydown">
- <Layouts>
- <Layout>
- <ListBox id="lst_dsList" taborder="7" innerdataset="@ds_datasetlist" datacolumn="id" codecolumn="id" scrollbars="autoboth" onitemchanged="lst_dsList_onitemdblclick" multiselect="false" onitemclick="lst_dsList_onitemclick" position="absolute 8 33 185 347" positiontype="position" anchor="all"/>
- <Splitter id="Splitter00" type="horizontal" style="border:4 double transparent #fefefeff;" position="absolute 183 31 190 347" positiontype="position" anchor="left top bottom" max="-1">
- <Formats>
- <Format id="default">
- <SplitterItems id="items">
- <SplitterItem id="item00" bindtype="resize" position="leftortop" offset="0" componentid="lst_dsList"/>
- <SplitterItem id="item01" bindtype="resize" position="rightorbottom" offset="0" componentid="div_right"/>
- <SplitterItem id="item02" bindtype="resize" position="leftortop" offset="0" componentid="edt_search"/>
- </SplitterItems>
- </Format>
- </Formats>
- </Splitter>
- <Div id="div_right" taborder="11" text="Div00" position="absolute 192 7 891 347" anchor="all" scrollbars="none">
- <Layouts>
- <Layout>
- <Tab id="tab_main" taborder="0" position2="absolute l:0 w:100% t:0 h:100%" scrollbars="autoboth" positiontype="position2">
- <Tabpages>
- <Tabpage id="tabpage1" text="DataSet">
- <Layouts>
- <Layout>
- <Grid id="grd_dataset" taborder="0" useinputpanel="false" cellsizingtype="both" position2="absolute l:0 w:100% t:0 h:100%" onmousemove="div_right_tab_main_tabpage1_grd_dataset_onmousemove" selecttype="cell" scrollbars="autoboth" extendsizetype="both" positiontype="position2" autoenter="select" readonly="false">
- <Formats>
- <Format id="default"/>
- </Formats>
- </Grid>
- </Layout>
- </Layouts>
- </Tabpage>
- <Tabpage id="tabpage2" text="XML">
- <Layouts>
- <Layout>
- <TextArea id="txa_xml" taborder="0" readonly="true" position2="absolute l:0 w:100% t:0 h:100%" positiontype="position2"/>
- </Layout>
- </Layouts>
- </Tabpage>
- <Tabpage id="tabpage3" text="CSV">
- <Layouts>
- <Layout>
- <TextArea id="txa_xml" taborder="0" readonly="true" position2="absolute l:0 w:100% t:0 h:100%" positiontype="position2"/>
- </Layout>
- </Layouts>
- </Tabpage>
- </Tabpages>
- </Tab>
- <CheckBox id="chk_filter" taborder="1" text="Filter" value="Y" truevalue="Y" falsevalue="N" onchanged="chk_filter_onchanged" position="absolute 179 0 240 20" anchor="left top" style="font:dotum,10,bold;"/>
- <Edit id="edt_filter" taborder="2" readonly="true" position="absolute 239 0 564 20" anchor="left top right"/>
- </Layout>
- </Layouts>
- </Div>
- <Edit id="edt_search" taborder="12" displaynulltext="dataset 찾기(like검색)" position="absolute 8 6 184 29" style="background:#ffffffff stretch 5,0;" autoselect="true" anchor="left top right" onkeyup="edt_search_onkeyup" imemode="none" ontextchanged="edt_search_ontextchanged"/>
- <Grid id="grid_detail" taborder="13" useinputpanel="false" binddataset="ds_datasetlist" autofittype="col" cellsizingtype="col" oncellclick="Grid00_oncellclick" onheaddblclick="Grid00_onheaddblclick" visible="true" anchor="left right bottom" position="absolute 8 352 890 372" positiontype="position">
- <Formats>
- <Format id="default">
- <Columns>
- <Column size="271"/>
- <Column size="247"/>
- <Column size="152"/>
- </Columns>
- <Rows>
- <Row size="19" band="head"/>
- <Row size="24"/>
- </Rows>
- <Band id="head">
- <Cell text="id"/>
- <Cell col="1" text="path"/>
- <Cell col="2" text="filter"/>
- </Band>
- <Band id="body">
- <Cell style="align:left;" text="bind:id"/>
- <Cell col="1" text="bind:path" expr="expr:getColumn(currow, "path").replace("this.opener", "")"/>
- <Cell col="2" text="bind:filter"/>
- </Band>
- </Format>
- </Formats>
- </Grid>
- <Edit id="Edit00" taborder="14" position="absolute 757 8 872 26" ontextchanged="Edit00_ontextchanged" anchor="top right"/>
- <Button id="btn_setcolumn" taborder="15" text="C" position="absolute 873 8 892 25" onclick="btn_setcolumn_onclick" anchor="top right"/>
- <Div id="div_column" taborder="17" text="Div00" position="absolute 192 62 432 341" style="background:bisque;border:1 solid #808080ff ;" visible="false" anchor="left top bottom">
- <Layouts>
- <Layout>
- <Grid id="grid_column" taborder="0" binddataset="ds_column" useinputpanel="false" autofittype="col" position="absolute 2 24 237 254" anchor="all">
- <Formats>
- <Format id="default">
- <Columns>
- <Column size="31"/>
- <Column size="149"/>
- </Columns>
- <Rows>
- <Row size="24" band="head"/>
- <Row size="24"/>
- </Rows>
- <Band id="head">
- <Cell displaytype="checkbox" edittype="checkbox"/>
- <Cell col="1" text="컬럼명"/>
- </Band>
- <Band id="body">
- <Cell displaytype="checkbox" edittype="checkbox" text="bind:chk"/>
- <Cell col="1" style="align:left;" text="bind:nm"/>
- </Band>
- </Format>
- </Formats>
- </Grid>
- <Button id="Button00" taborder="1" text="적용" position="absolute 189 256 237 276" anchor="right bottom" onclick="div_column_Button00_onclick"/>
- <Edit id="edt_filter" taborder="2" position="absolute 1 2 237 22" ontextchanged="div_column_edt_filter_ontextchanged" anchor="left top right"/>
- </Layout>
- </Layouts>
- </Div>
- </Layout>
- </Layouts>
- <Objects>
- <Dataset id="ds_datasetlist" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
- <ColumnInfo>
- <Column id="id" type="STRING" size="256"/>
- <Column id="path" type="STRING" size="256"/>
- <Column id="filter" type="STRING" size="256"/>
- </ColumnInfo>
- </Dataset>
- <Dataset id="ds_column" firefirstcount="0" firenextcount="0" useclientlayout="false" updatecontrol="true" enableevent="true" loadkeymode="keep" loadfiltermode="keep" reversesubsum="false">
- <ColumnInfo>
- <Column id="chk" type="INT" size="1"/>
- <Column id="nm" type="STRING" size="256"/>
- </ColumnInfo>
- </Dataset>
- </Objects>
- <Script type="xscript4.0"><![CDATA[/************************************************************************************************
- * 파 일 명 : SSZFM00401_DataSetRtrv.xfdl
- * 작 성 자 : kkm
- * 작 성 일 : 2014.03.19
- * 설 명 : DataSet 미리보기
- * 수 정 자 :
- * 수정이력 :
- ************************************************************************************************/
- include "com_commonxp::comm_main.xjs";
- /******************************* Form Variable *************************************************/
- var dsCurrent = null; //선택한 DataSet
- var preDS = "";
- var curDepth = 0; //form 안에 control depth
- var curPath = ""; //depth에 따른 객체 위치
- /************************************************************************************************
- ******************************** Form Event ****************************************************
- ************************************************************************************************/
- /********************************************************************************
- * 설 명 : onload 이벤트
- ********************************************************************************/
- function SSZFM00401_DataSetRtrv_onload(obj:Form, e:LoadEventInfo)
- {
- lf_searchDataSet(this.opener);
-
- grdf_initGrid(div_column.grid_column); //sort와 전체체크박스 둘다 사용시
-
- edt_search.setFocus();
- }
- /********************************************************************************
- * 설 명 : list itemclick 이벤트
- ********************************************************************************/
- function lst_dsList_onitemdblclick(obj:ListBox, e:ItemChangeEventInfo)
- {
- var datasetName = obj.value;
- edt_search.value = datasetName;
- var row = ds_datasetlist.findRow("id", datasetName);
- var path = ds_datasetlist.getColumn(row, "path");
- var filter = ds_datasetlist.getColumn(row, "filter");
- var tmpObj = path + ".objects['" + datasetName + "']";
-
- dsCurrent = eval(tmpObj);
- if(dsCurrent == null) return; //ds가 없는 경우
- dsCurrent.filter(div_right.chk_filter.value == "Y" ? filter : "");
-
- div_right.edt_filter.value = filter;
- div_right.tab_main.tabpage1.grd_dataset.binddataset = dsCurrent;
- div_right.tab_main.tabpage1.grd_dataset.createFormat();
- div_right.tab_main.tabpage2.txa_xml.value = dsCurrent.saveXML(datasetName, div_right.chk_filter.value == "Y" ? "V" : "A");
- div_right.tab_main.tabpage3.txa_xml.value = dsCurrent.saveCSV(datasetName);
-
- // readonly 형태로 변경
- var gridColCnt = div_right.tab_main.tabpage1.grd_dataset.getFormatColCount();
- for(var i=0; i < gridColCnt; i++) {
- div_right.tab_main.tabpage1.grd_dataset.setCellProperty("body", i, "displaytype", "text");
- div_right.tab_main.tabpage1.grd_dataset.setCellProperty("body", i, "edittype", "readonly");
- div_right.tab_main.tabpage1.grd_dataset.setCellProperty("body", i, "editautoselect", "true");
- }
-
- // 이전 선택한 데이터셋
- var obj = div_right.tab_main.tabpage1.grd_dataset;
-
- if(e.pretext != e.posttext){
- ds_column.clearData();
- for(var i=0; i<obj.getCellCount("Head"); i++){
- var iRow = ds_column.addRow();
- ds_column.setColumn(iRow, "nm", obj.getCellText(-1, i));
- }
-
- if(ds_column.rowcount > 0){
- ds_column.rowposition = 0;
- }
- }
-
- }
- /********************************************************************************
- * 설 명 : changed 이벤트
- ********************************************************************************/
- function chk_filter_onchanged(obj:CheckBox, e:CheckBoxChangeEventInfo)
- {
- if(ds_datasetlist.rowposition == -1) return;
-
- var dsCurrent = ds_datasetlist.getColumn(lst_dsList.index, "id");
- var path = ds_datasetlist.getColumn(lst_dsList.index, "path");
- var filter = ds_datasetlist.getColumn(lst_dsList.index, "filter");
- var tmpObj = eval(path + ".objects['" + dsCurrent + "']");
-
- if(tmpObj == null || String(tmpObj) == 'undefined') return;
-
- tmpObj.filter(div_right.chk_filter.value == "Y" ? filter : "");
- }
- /********************************************************************************
- * 설 명 : onmousemove 이벤트
- ********************************************************************************/
- function div_right_tab_main_tabpage1_grd_dataset_onmousemove(obj:Grid, e:GridMouseEventInfo)
- {
- if (e.row < 0) return;
- if(parseInt(e.cell) < 0 || parseInt(e.row) < 0) return;
-
- var objExtCommon = new ExtCommon();
- var sCellTextLen = objExtCommon.getTextExtent(div_right.tab_main.tabpage1.grd_dataset, obj.getCellText(e.row, e.cell));
- if (sCellTextLen[1] > obj.getRealColSize(e.cell)){
- obj.tooltiptext = obj.getCellText(e.row, e.cell); //cell의 width 보다 클 경우만 tooltiptext 셋팅.
- }else{
- obj.tooltiptext = ""; //tooltiptext 초기화
- }
- }
- /********************************************************************************
- * 설 명 : onkeyup 이벤트
- ********************************************************************************/
- function edt_search_onkeyup(obj:Edit, e:KeyEventInfo)
- {
-
- obj.updateToDataset();
-
- //if(!lf_checkAlpaNum(obj.value)) return; //입력값이 한글이면 return
- if( !utlf_isNull(obj.value)){
- ds_datasetlist.filter("String(id).indexOf('" + obj.value + "') >= 0");
- }else{
- ds_datasetlist.filter("");
- obj.value = null;
- }
-
- // if(obj.value.length > 0){
- // ds_datasetlist.filter("String(id).indexOf('" + obj.value + "') >= 0");
- // }else{
- // ds_datasetlist.filter("");
- // obj.value = null;
- // }
- }
- function edt_search_ontextchanged(obj:Edit, e:TextChangedEventInfo)
- {
- trace("obj.value : " + obj.value);
-
- obj.updateToDataset();
-
-
- if ( ! utlf_isNull(obj.value) )
- {
- ds_datasetlist.filter("String(id).indexOf('" + obj.value + "') >= 0");
- }
- else
- {
- ds_datasetlist.filter("");
- }
- }
- /************************************************************************************************
- Form Function
- ************************************************************************************************/
- /********************************************************************************
- * 설 명 : form 안에 있는 DataSet을 찾는 함수(재귀 함수)
- * argument : parentObj : 부모 객체
- path : 현재 선택 된 객체 이름
- ********************************************************************************/
- function lf_searchDataSet(parentObj, path) {
-
- if(parentObj == null) return;
-
- if(curDepth > 0){
- path = curPath + "." + path;
- }else{
- if(path == null || path == "undefined"){
- path = "this.opener";
- }else{
- path = "this.opener." + path + "." + parentObj.name;
- }
- }
-
- var arrayCompList = parentObj.all;
-
- if(arrayCompList == "undefined") return;
-
- for(var i=0, len=arrayCompList.length ; i < len; i++){
-
- if(arrayCompList[i] instanceof Dataset){
-
- if(arrayCompList[i].name == "undefined") continue;
-
- var curRow = ds_datasetlist.addRow();
-
- ds_datasetlist.setColumn(curRow, "id", arrayCompList[i].name);
- ds_datasetlist.setColumn(curRow, "path", path);
- ds_datasetlist.setColumn(curRow, "filter", arrayCompList[i].filterstr);
-
- }else if(arrayCompList[i] instanceof Div || String(arrayCompList[i]).substring(0, 3) == "cp_"){ //Div 또는 공통 Composite 컨트롤 일 경우
-
- curDepth++;
- curPath = path;
- lf_searchDataSet(arrayCompList[i], arrayCompList[i].name);
- curDepth --;
-
- }else if(arrayCompList[i] instanceof Tab){ //Tab control일 경우
- var TabPageList = arrayCompList[i].components;
-
- curDepth++;
- curPath = path;
-
- for(var j=0; j < TabPageList.length; j++){
- lf_searchDataSet(TabPageList[j], arrayCompList[i].name + "." + TabPageList[j].name);
- curPath = "this.opener";
- }
- curDepth --;
- }
- }
- }
- /********************************************************************************
- * 설 명 : 알파벳과 숫자 여부 체크
- * argument : sString : 체크할 스트링
- ********************************************************************************/
- function lf_checkAlpaNum(sString)
- {
- var sVal = "";
- var bVal = false;
- for (var i = 0; i < sString.length; i++) {
- var sVal = sString.charCodeAt(i);
- if ((sVal >= 48 && sVal <=57) || (sVal >=65 && sVal <= 90) || (sVal >= 97 && sVal <= 122)){
- bVal = true;
- }else{
- bVal = false;
- break;
- }
- }
-
- return bVal;
- }
- function Grid00_oncellclick(obj:Grid, e:GridClickEventInfo)
- {
- var row = ds_datasetlist.rowposition;
- var id = ds_datasetlist.getColumn(row, "id");
-
- edt_search.value = id;
-
- var path = ds_datasetlist.getColumn(row, "path");
- var filter = ds_datasetlist.getColumn(row, "filter");
- var tmpObj = path + ".objects['" + id + "']";
-
- dsCurrent = eval(tmpObj);
- if(dsCurrent != null){
- dsCurrent.filter(div_right.chk_filter.value == "Y" ? filter : "");
-
- div_right.edt_filter.value = filter;
- div_right.tab_main.tabpage1.grd_dataset.binddataset = dsCurrent;
- div_right.tab_main.tabpage1.grd_dataset.createFormat();
- div_right.tab_main.tabpage2.txa_xml.value = dsCurrent.saveXML(id, div_right.chk_filter.value == "Y" ? "V" : "A");
- div_right.tab_main.tabpage3.txa_xml.value = dsCurrent.saveCSV(id);
-
- // 이전 선택한 데이터셋
- var obj = div_right.tab_main.tabpage1.grd_dataset;
- var pre = ds_datasetlist.getColumn(e.oldrow, "id");
-
- if(pre != id){
- ds_column.clearData();
- for(var i=0; i<obj.getCellCount("Head"); i++){
- var iRow = ds_column.addRow();
- ds_column.setColumn(iRow, "nm", obj.getCellText(-1, i));
- }
-
- if(ds_column.rowcount > 0){
- ds_column.rowposition = 0;
- }
- }
- }else{
- trace("No Dataset");
- }
- }
- function Edit00_ontextchanged(obj:Edit, e:TextChangedEventInfo)
- {
- if(e.posttext == ""){
- for(var i=0; i<div_right.tab_main.tabpage1.grd_dataset.getCellCount("body"); i++){
- div_right.tab_main.tabpage1.grd_dataset.setRealColSize(i, "100");
- }
- }else{
- var idx = div_right.tab_main.tabpage1.grd_dataset.getBindCellIndex("body", e.posttext);
-
- for(var i=0; i<div_right.tab_main.tabpage1.grd_dataset.getCellCount("body"); i++){
- var text = div_right.tab_main.tabpage1.grd_dataset.getCellProperty("body", i, "text");
- if(text != "")
- text = text.replace("bind:", "");
-
- if( text.indexOf(e.posttext) > -1){
- div_right.tab_main.tabpage1.grd_dataset.setRealColSize(i, "100");
- }else{
- div_right.tab_main.tabpage1.grd_dataset.setRealColSize(i, "0");
- }
- }
- }
- }
- function setViewColumn(sColNM)
- {
- if(sColNM == ""){
- for(var i=0; i<div_right.tab_main.tabpage1.grd_dataset.getCellCount("body"); i++){
- div_right.tab_main.tabpage1.grd_dataset.setRealColSize(i, "100");
- }
- }else{
- var idx = div_right.tab_main.tabpage1.grd_dataset.getBindCellIndex("body", sColNM);
-
- for(var i=0; i<div_right.tab_main.tabpage1.grd_dataset.getCellCount("body"); i++){
- var text = div_right.tab_main.tabpage1.grd_dataset.getCellProperty("body", i, "text");
- if(text != "")
- text = text.replace("bind:", "");
-
- if( text.indexOf(e.posttext) > -1){
- div_right.tab_main.tabpage1.grd_dataset.setRealColSize(i, "100");
- }else{
- div_right.tab_main.tabpage1.grd_dataset.setRealColSize(i, "0");
- }
- }
- }
- }
- function div_column_Button00_onclick(obj:Button, e:ClickEventInfo)
- {
- ds_column.filter("");
- for(var i=0; i<ds_column.rowcount; i++){
-
- if(ds_column.getColumn(i, "chk") == 1){
- div_right.tab_main.tabpage1.grd_dataset.setRealColSize(i, "100");
- }else{
- div_right.tab_main.tabpage1.grd_dataset.setRealColSize(i, "0");
- }
- }
- div_column.visible = false;
- }
- function btn_setcolumn_onclick(obj:Button, e:ClickEventInfo)
- {
- div_column.visible = true;
- }
- function Grid00_onheaddblclick(obj:Grid, e:GridClickEventInfo)
- {
- if(grid_detail.position.height == 20){
- grid_detail.position.top = this.getOwnerFrame().form.position.bottom - 175;
- grid_detail.position.height = "165";
- }else{
- grid_detail.position.top = this.getOwnerFrame().form.position.bottom - 31;
- grid_detail.position.height = "20";
- }
- }
- function div_column_edt_filter_ontextchanged(obj:Edit, e:TextChangedEventInfo)
- {
- ds_column.filter("String(nm).indexOf('" + (e.posttext).replace("''","\\'") + "')>=0");
- }
- function SSZFM00401_DataSetRtrv_onkeydown(obj:Form, e:KeyEventInfo)
- {
- if(e.keycode == "27"){
- this.close();
- }
- }
- function edt_search_ontextchanged(obj:Edit, e:TextChangedEventInfo)
- {
-
- }
- ]]></Script>
- </Form>
- </FDL>
|