{"action":"created","issue":{"url":"https://api.github.com/repos/axisj/axisj/issues/595","labels_url":"https://api.github.com/repos/axisj/axisj/issues/595/labels{/name}","comments_url":"https://api.github.com/repos/axisj/axisj/issues/595/comments","events_url":"https://api.github.com/repos/axisj/axisj/issues/595/events","html_url":"https://github.com/axisj/axisj/issues/595","id":84922233,"number":595,"title":"axgrid 에서  editor 에 관한 질문입니다. ","user":{"login":"young-tae","id":12082549,"avatar_url":"https://avatars.githubusercontent.com/u/12082549?v=3","gravatar_id":"","url":"https://api.github.com/users/young-tae","html_url":"https://github.com/young-tae","followers_url":"https://api.github.com/users/young-tae/followers","following_url":"https://api.github.com/users/young-tae/following{/other_user}","gists_url":"https://api.github.com/users/young-tae/gists{/gist_id}","starred_url":"https://api.github.com/users/young-tae/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/young-tae/subscriptions","organizations_url":"https://api.github.com/users/young-tae/orgs","repos_url":"https://api.github.com/users/young-tae/repos","events_url":"https://api.github.com/users/young-tae/events{/privacy}","received_events_url":"https://api.github.com/users/young-tae/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/axisj/axisj/labels/bug","name":"bug","color":"fc2929"}],"state":"open","locked":false,"assignee":{"login":"hyunjun19","id":421863,"avatar_url":"https://avatars.githubusercontent.com/u/421863?v=3","gravatar_id":"","url":"https://api.github.com/users/hyunjun19","html_url":"https://github.com/hyunjun19","followers_url":"https://api.github.com/users/hyunjun19/followers","following_url":"https://api.github.com/users/hyunjun19/following{/other_user}","gists_url":"https://api.github.com/users/hyunjun19/gists{/gist_id}","starred_url":"https://api.github.com/users/hyunjun19/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyunjun19/subscriptions","organizations_url":"https://api.github.com/users/hyunjun19/orgs","repos_url":"https://api.github.com/users/hyunjun19/repos","events_url":"https://api.github.com/users/hyunjun19/events{/privacy}","received_events_url":"https://api.github.com/users/hyunjun19/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-06-04T05:26:49Z","updated_at":"2015-06-04T14:34:28Z","closed_at":null,"body":"axgrid 에서  editor 에 관한 질문입니다. \r\n\r\n아래 소스에서 key : combobox 이거에 대한 질문입니다. \r\n아래와 같이  editor에서   select 에  \r\noptionValue , optionText를 다른걸로 지정을했는데 \r\n\r\n수정을할때 selectbox의 아이템을 선택하면   formatter 에 \r\nthis.value 가 {FULLCD: \"2\", CODE_NM: \"장기영\"} 이렇게 들어오는데 \r\nselectbox를 선택하지 않고 그냥 다른곳을 클릭하면 \r\nthis.value가 {optionValue: \"2\", optionText: \"장기영\"} 이렇게 찍히고 있습니다. \r\n\r\n그래서 다시 selectbox를 선택하면 그전에 선택한 값이 아닌 다른값이 나오고 있습니다  \r\n\r\n선택을 하지 않아도 editor 에서 지정한  optionValue , optionText 나오게 할려면 어떻해 해야되나요 ?\r\n\r\n소스에서 //<-------- 문의 내용 시작 -----> 이 부분 참고 하시면 될것 같습니다. \r\n \r\n\r\n```html\r\n<!DOCTYPE html>\r\n<html lang=\"ko\">\r\n<head>\r\n\t<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" /><meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\" />\r\n\t<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\" />\r\n\r\n\t<meta name=\"viewport\" content=\"width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1.0, minimum-scale=1\" />\r\n\t<title>input blur test 기본</title>\r\n\r\n \r\n\r\n   <!-- css block -->\r\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"http://cdn.axisj.com/axicon/axicon.min.css\" rel=\"stylesheet\" />\r\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"http://dev.axisj.com/ui/arongi/page.css\" />\r\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"http://dev.axisj.com/ui/arongi/AXJ.min.css\" />\r\n    <link rel=\"stylesheet\" type=\"text/css\" href=\"http://dev.axisj.com/ui/arongi/AXGrid.css\" />\r\n\r\n    <style type=\"text/css\">\r\n    </style>\r\n    <!-- css block -->\r\n\r\n    <!-- js block -->\r\n    <script type=\"text/javascript\" src=\"http://dev.axisj.com/jquery/jquery.min.js\"></script>\r\n    <script type=\"text/javascript\" src=\"http://dev.axisj.com/dist/AXJ.min.js\"></script>\r\n\r\n\r\n    <!-- js block -->\r\n\t<style type=\"text/css\">\r\n\t\r\n\t</style>\r\n</head>\r\n\t\r\n<body>\r\n\r\n<div id=\"AXPage\">\r\n\r\n\t<div id=\"AXPageBody\" class=\"SampleAXSelect\">\r\n        <div id=\"demoPageTabTarget\" class=\"AXdemoPageTabTarget\"></div>\r\n\t\t<div class=\"AXdemoPageContent\">\r\n\r\n            <div id=\"grid0\">\r\n                <h2>AXGrid</h2>\r\n                <div id=\"AXGridTarget\" style=\"height:300px;\"></div>\r\n                <div style=\"padding:10px;\">\r\n                    <input type=\"button\" value=\"getSelectedItem\" class=\"AXButton\" onclick=\"fnObj.grid.getSelectedItem();\" />\r\n\t                <input type=\"button\" value=\"추가하기\" class=\"AXButton Red\" onclick=\"fnObj.grid.append();\" />\r\n\t                <input type=\"button\" value=\"삭제하기\" class=\"AXButton Red\" onclick=\"fnObj.grid.remove();\" />\r\n                </div>\r\n\t            <div style=\"padding:10px;\">\r\n\t\t            <input type=\"button\" value=\"forExcel html with filter\" class=\"AXButton\" onclick=\"fnObj.grid.getExcel('html');\" />\r\n\t            </div>\r\n\r\n            </div>\r\n\t\t</div>\r\n\t</div>\r\n\r\n</div>\r\n\r\n<script>\r\n    /**\r\n     * Require Files for AXISJ UI Component...\r\n     * Based\t\t: jQuery\r\n     * Javascript \t: AXJ.js, AXGrid.js, AXInput.js, AXSelect.js\r\n     * CSS\t\t\t: AXJ.css, AXGrid.css, AXButton.css, AXInput.css, AXSelect.css\r\n     */\r\n    var pageID = \"inline-edit\";\r\n    var fnObj = {\r\n        pageStart: function(){\r\n            fnObj.grid.bind();\r\n        },\r\n        grid: {\r\n            target: new AXGrid(),\r\n            bind: function(){\r\n                window.myGrid = fnObj.grid.target;\r\n\r\n\t            myGrid.setConfig({\r\n\t\t            targetID : \"AXGridTarget\",\r\n\t\t            sort:false,\r\n\t\t            //fitToWidth:true, // 너비에 자동 맞춤\r\n\t\t            passiveMode:true,\r\n\t\t            passiveRemoveHide:true,\r\n\r\n\t\t            colGroup : [\r\n\t\t\t            {key:\"no\", label:\"번호\", width:\"50\", align:\"center\", formatter:\"checkbox\"},\r\n\t\t\t            {\r\n\t\t\t\t            key:\"_CUD\", label:\"상태\", width:\"50\", align:\"center\"\r\n\t\t\t            },\r\n\t\t\t            {\r\n\t\t\t\t            key:\"cont\", label:\"String22\", width:\"200\"\r\n\t\t\t            },\r\n\t\t\t            {\r\n\t\t\t\t\t\t\t//<-------- 문의 내용 시작 ----->\r\n\t\t\t\t            key:\"combobox\", label:\"combobox\", width:\"100\",\r\n\t\t\t\t            editor: {\r\n\t\t\t\t\t            type: \"select\",\r\n\t\t\t\t\t            optionValue: \"FULLCD\",\r\n\t\t\t\t\t            optionText: \"CODE_NM\",\r\n\t\t\t\t\t            options:[\r\n\t\t\t\t\t\t            {FULLCD:1, CODE_NM:\"김기영\"},\r\n\t\t\t\t\t\t            {FULLCD:2, CODE_NM:\"장기영\"},\r\n\t\t\t\t\t\t            {FULLCD:\"3\", CODE_NM:\"장서우\"}\r\n\t\t\t\t\t            ]\r\n\t\t\t\t\t\t\t\t, beforeUpdate: function(val){ // 수정이 되기전 value를 처리 할 수 있음.\r\n\t\t\t\t\t\t            return val;\r\n\t\t\t\t\t            }\r\n\t\t\t\t            }\r\n\t\t\t\t\t\t\t,formatter: function(val){\r\n\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t// 선택시 결과값 Object {FULLCD: \"2\", CODE_NM: \"장기영\"}\r\n\t\t\t\t\t\t\t\t// 선택하지 않을때 결과값  Object {optionValue: \"2\", optionText: \"장기영\"}\r\n\t\t\t\t\t\t\t\tconsole.log(this.value)\r\n\t\t\t\t\t            if(Object.isObject(this.value)){\r\n\t\t\t\t\t\t            return this.value.CODE_NM;\r\n\t\t\t\t\t            }else{\r\n\t\t\t\t\t\t            return this.value;\r\n\t\t\t\t\t            }\r\n\t\t\t\t            }\r\n\t\t\t\t\t\t\t//<-------- 문의 내용 끝 ----->\r\n\t\t\t            },\r\n\t\t\t            {\r\n\t\t\t\t            key:\"combobox2\", label:\"combobox2\", width:\"100\",\r\n\t\t\t\t            formatter: function(val){\r\n\t\t\t\t\t            if(Object.isObject(this.value)){\r\n\t\t\t\t\t\t            return this.value.NM;\r\n\t\t\t\t\t            }else{\r\n\t\t\t\t\t\t            return this.value;\r\n\t\t\t\t\t            }\r\n\t\t\t\t            },\r\n\t\t\t\t            editor: {\r\n\t\t\t\t\t            type: \"AXSelect\",\r\n\t\t\t\t\t            config: {\r\n\t\t\t\t\t\t            reserveKeys: {\r\n\t\t\t\t\t\t\t            options: \"list\",\r\n\t\t\t\t\t\t\t            optionValue: \"CD\",\r\n\t\t\t\t\t\t\t            optionText: \"NM\"\r\n\t\t\t\t\t\t            },\r\n\t\t\t\t\t\t            ajaxUrl: \"selectData-01.php\",\r\n\t\t\t\t\t\t            ajaxPars: \"\",\r\n\t\t\t\t\t\t            onchange: function(){\r\n\t\t\t\t\t\t\t            // inline editor 에 선언한 onchange함수는 AXGrid내부에서 사용하는 onchange 함수로 변경되어 사용할 수 없습니다.\r\n\t\t\t\t\t\t            }\r\n\t\t\t\t\t            },\r\n\t\t\t\t\t            beforeUpdate: function(val){ // 수정이 되기전 value를 처리 할 수 있음.\r\n\t\t\t\t\t\t            // 선택된 값은\r\n\t\t\t\t\t\t            console.log(val);\r\n\t\t\t\t\t\t            return val;\r\n\t\t\t\t\t            },\r\n\t\t\t\t\t            afterUpdate: function(val){ // 수정이 처리된 후\r\n\t\t\t\t\t\t            // 수정이 된 후 액션.\r\n\t\t\t\t\t\t            //console.log(this);\r\n\t\t\t\t\t            }\r\n\t\t\t\t            }\r\n\t\t\t            },\r\n\t\t\t            {\r\n\t\t\t\t            key:\"date\", label:\"date\", width:\"105\", align:\"center\",\r\n\t\t\t\t            editor: {\r\n\t\t\t\t\t            type: \"calendar\",\r\n\t\t\t\t\t            config: {\r\n\t\t\t\t\t\t            separator: \"/\"\r\n\t\t\t\t\t            },\r\n\t\t\t\t\t            updateWith: [\"_CUD\"]\r\n\t\t\t\t            }\r\n\t\t\t            },\r\n\t\t\t            {\r\n\t\t\t\t            key:\"money\", label:\"money\", width:\"100\", align:\"right\",\r\n\t\t\t\t            formatter:\"money\",\r\n\t\t\t\t            editor: {\r\n\t\t\t\t\t            type: \"money\",\r\n\t\t\t\t\t            updateWith: [\"number\",\"_CUD\"]\r\n\t\t\t\t            }\r\n\t\t\t            },\r\n\t\t\t            {\r\n\t\t\t\t            key:\"number\", label:\"number\", width:\"80\", align:\"right\",\r\n\t\t\t\t            formatter:\"money\",\r\n\t\t\t\t            editor: {\r\n\t\t\t\t\t            type: \"number\",\r\n\t\t\t\t\t            updateWith: [\"money\",\"_CUD\"]\r\n\t\t\t\t            }\r\n\t\t\t            },\r\n\t\t\t            {\r\n\t\t\t\t            key:\"checkbox\", label:\"checkbox\", width:\"50\", align:\"center\",\r\n\t\t\t\t            editor: {\r\n\t\t\t\t\t            type: \"checkbox\",\r\n\t\t\t\t\t            beforeUpdate: function(val){\r\n\t\t\t\t\t\t            return (val == true) ? \"Y\" : \"N\";\r\n\t\t\t\t\t            }\r\n\t\t\t\t            }\r\n\t\t\t            },\r\n\t\t\t            {\r\n\t\t\t\t            key:\"radio\", label:\"radio\", width:\"50\", align:\"center\",\r\n\t\t\t\t            editor: {\r\n\t\t\t\t\t            type: \"radio\"\r\n\t\t\t\t            }\r\n\t\t\t            },\r\n\t\t\t            {\r\n\t\t\t\t            key:\"finder\", label:\"finder\", width:\"100\", align:\"center\",\r\n\t\t\t\t            editor: {\r\n\t\t\t\t\t            type: \"finder\",\r\n\t\t\t\t\t            formatter: function(){\r\n\t\t\t\t\t\t            return (this.item.finder || \"\");\r\n\t\t\t\t\t            },\r\n\t\t\t\t\t            finder: {\r\n\t\t\t\t\t\t            onclick: function(){\r\n\t\t\t\t\t\t\t            alert(\"새창 열기\");\r\n\t\t\t\t\t\t            }\r\n\t\t\t\t\t            }\r\n\t\t\t\t            }\r\n\t\t\t            }\r\n\t\t            ],\r\n\t\t            colHeadAlign: \"center\", // 헤드의 기본 정렬 값 ( colHeadAlign 을 지정하면 colGroup 에서 정의한 정렬이 무시되고 colHeadAlign : false 이거나 없으면 colGroup 에서 정의한 속성이 적용됩니다.\r\n\t\t            body : {\r\n\t\t\t            onclick: function(){\r\n\t\t\t\t            //trace(this.index);\r\n\t\t\t            }\r\n\t\t            },\r\n\t\t            page: {\r\n\t\t\t            paging: false\r\n\t\t            }\r\n\t\t\t\t\t,editor: { // 예제) http://localhost/axisj/samples/AXGrid/passive.html\r\n\t\t\t\t\t\trows: [\r\n\t\t\t\t\t\t\t[\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tcolSeq:2,\r\n\t\t\t\t\t\t\t\t\talign:\"center\",\r\n\t\t\t\t\t\t\t\t\tvalign:\"middle\",\r\n\t\t\t\t\t\t\t\t\tformatter: function(){},\r\n\t\t\t\t\t\t\t\t\tform: {\r\n\t\t\t\t\t\t\t\t\t\ttype    : \"readonly\",  // {String} -- \"hidden\"|\"text\"|\"readonly\"|\"textarea\"|\"select\"|\"radio\"|\"checkbox\"\r\n\t\t\t\t\t\t\t\t\t\tvalue   : \"itemValue\", // {String|Function} -- \"itemValue\"|\"itemText\": 해당 아이템의 값을 사용합니다. function을 사용해야 하는 경우 아래 formValue 함수를 참고하세요.\r\n\t\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t\t\tonFocus : function (){ console.log('onFocus()')},  // {Function} -- 아래 formOnFocus 함수를 참고하세요.\r\n\t\t\t\t\t\t\t\t\t\tvalidate: function(formID, value){ // {Function} 입력된 값을 확인합니다.\r\n\t\t\t\t\t\t\t\t\t\t\t//this.formID\r\n\t\t\t\t\t\t\t\t\t\t\t//this.value\r\n\t\t\t\t\t\t\t\t\t\t\t//this.checkedValues\r\n\t\t\t\t\t\t\t\t\t\t\t//this.form\r\n\t\t\t\t\t\t\t\t\t\t\treturn true | false;\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t\tAXBind:{\r\n\t\t\t\t\t\t\t\t\t\ttype  : \"selector\", // {String} -- form.type == \"text\"인 경우 \"number\"|\"money\"|\"selector\"|\"slider\"|\"twinSlider\"|\"date\"|\"twinDate\"|\"dateTime\"|\"switch\"를 사용할 수 있습니다. form.type == \"select\"인 경우 \"select\"를 사용할 수 있습니다.\r\n\t\t\t\t\t\t\t\t\t\tconfig: {} // {Object} -- API(http://jdoc.axisj.com/jQueryExtends.html)에서 bind + type으로 검색하세요.\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t]\r\n\t\t\t\t\t\t],\r\n\t\t\t\t\t}\r\n\t            });\r\n\t\t\t\t\r\n\t            var list = [\r\n\t\t            {\r\n\t\t\t            no:1,\r\n\t\t\t            cont: \"AXGrid 첫번째 줄 입니다.\",\r\n\t\t\t            combobox: {FULLCD:1, CODE_NM:\"김기영\"},\r\n\t\t\t            combobox2: {CD:1, NM:\"김기영\"},\r\n\t\t\t            date: \"2013-01-18\",\r\n\t\t\t            money: 1709401,\r\n\t\t\t            number: 10,\r\n\t\t\t            checkbox: 1,\r\n\t\t\t            radio: 1,\r\n\t\t\t           finder: \"선택\"\r\n\t\t            },\r\n\t\t            {\r\n\t\t\t            no:2,\r\n\t\t\t            cont: \"AXGrid 첫번째 줄 입니다.\",\r\n\t\t\t            combobox: 2,\r\n\t\t\t            combobox2: {CD:1, NM:\"김기영\"},\r\n\t\t\t            date: \"2013-01-18\",\r\n\t\t\t            money: 1709401,\r\n\t\t\t            number: 10,\r\n\t\t\t            checkbox: 1,\r\n\t\t\t            radio: 1,\r\n\t\t\t            finder: \"선택\"\r\n\t\t            },\r\n\t\t            {\r\n\t\t\t            no:3,\r\n\t\t\t            cont: \"AXGrid 첫번째 줄 입니다.\",\r\n\t\t\t            combobox: 3,\r\n\t\t\t            combobox2: {CD:1, NM:\"김기영\"},\r\n\t\t\t            date: \"2013-01-18\",\r\n\t\t\t            money: 1709401,\r\n\t\t\t            number: 10,\r\n\t\t\t            checkbox: 1,\r\n\t\t\t            radio: 1,\r\n\t\t\t            finder: \"선택\"\r\n\t\t            }\r\n\t            ];\r\n                myGrid.setList(list);\r\n                //trace(myGrid.getSortParam());\r\n\r\n            },\r\n            getExcel: function(type){\r\n                var obj = myGrid.getExcelFormat(type, function(){\r\n\t                return this.key != \"no\" && this.key != \"finder\";\r\n                });\r\n                $(\"#printout\").html(obj);\r\n            },\r\n            getSelectedItem: function(){\r\n                trace( this.target.getSelectedItem() );\r\n                toast.push('콘솔창에 데이터를 출력하였습니다.');\r\n            },\r\n\t        append: function(){\r\n\t\t        this.target.pushList(\r\n\t\t\t        {\r\n\t\t\t\t        no:this.target.list.length,\r\n\t\t\t\t        cont: \"\",\r\n\t\t\t\t        combobox: {optionValue:1, optionText:\"김기영\"},\r\n\t\t\t\t        date: \"2013-01-18\",\r\n\t\t\t\t        money: 1709401,\r\n\t\t\t\t        number: 10,\r\n\t\t\t\t        checkbox: 1,\r\n\t\t\t\t        radio: 1,\r\n\t\t\t\t        finder: \"선택\"\r\n\t\t\t        }\r\n\t\t        );\r\n\t\t        this.target.setFocus(this.target.list.length-1);\r\n\t        },\r\n\t        remove: function(){\r\n\t\t        var checkedList = myGrid.getCheckedListWithIndex(0);// colSeq\r\n\t\t        if(checkedList.length == 0){\r\n\t\t\t        alert(\"선택된 목록이 없습니다. 삭제하시려는 목록을 체크하세요\");\r\n\t\t\t        return;\r\n\t\t        }\r\n\t\t        this.target.removeListIndex(checkedList);\r\n\t\t        // 전달한 개체와 비교하여 일치하는 대상을 제거 합니다. 이때 고유한 값이 아닌 항목을 전달 할 때에는 에러가 발생 할 수 있습니다.\r\n\t        }\r\n        }\r\n    };\r\n    jQuery(document.body).ready(function() {\r\n        fnObj.pageStart();\r\n    });\r\n\r\n\r\n</script>\r\n</body>\r\n</html>\t\t\r\n\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/axisj/axisj/issues/comments/108916395","html_url":"https://github.com/axisj/axisj/issues/595#issuecomment-108916395","issue_url":"https://api.github.com/repos/axisj/axisj/issues/595","id":108916395,"user":{"login":"hyunjun19","id":421863,"avatar_url":"https://avatars.githubusercontent.com/u/421863?v=3","gravatar_id":"","url":"https://api.github.com/users/hyunjun19","html_url":"https://github.com/hyunjun19","followers_url":"https://api.github.com/users/hyunjun19/followers","following_url":"https://api.github.com/users/hyunjun19/following{/other_user}","gists_url":"https://api.github.com/users/hyunjun19/gists{/gist_id}","starred_url":"https://api.github.com/users/hyunjun19/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hyunjun19/subscriptions","organizations_url":"https://api.github.com/users/hyunjun19/orgs","repos_url":"https://api.github.com/users/hyunjun19/repos","events_url":"https://api.github.com/users/hyunjun19/events{/privacy}","received_events_url":"https://api.github.com/users/hyunjun19/received_events","type":"User","site_admin":false},"created_at":"2015-06-04T14:34:28Z","updated_at":"2015-06-04T14:34:28Z","body":"버그 수정되었습니다.\r\n정식 릴리즈 되기까지는 시간이 좀 걸릴 수 있으니 급하신 경우 https://github.com/axisj/axisj/commit/48ec418d336dfa2c67cd8b3308a56aca6f77b9e9 여기를 참고하세요."}}