{"id":127,"date":"2014-02-24T12:03:20","date_gmt":"2014-02-24T03:03:20","guid":{"rendered":"http:\/\/www.fsquare.co.kr\/?p=127"},"modified":"2015-02-18T15:59:27","modified_gmt":"2015-02-18T06:59:27","slug":"extjs-%ed%95%98%eb%93%9c%ec%bd%94%eb%94%a9%ec%9c%bc%eb%a1%9c-%ec%97%b0%ec%8a%b5%ed%95%98%ea%b8%b0-2","status":"publish","type":"post","link":"https:\/\/www.fsquare.co.kr\/?p=127","title":{"rendered":"ExtJs \ud558\ub4dc\ucf54\ub529\uc73c\ub85c \uc5f0\uc2b5\ud558\uae30 &#8211; 2"},"content":{"rendered":"<p>\uccab\ubc88\uc9f8 \ubcf5\ud569 frame\uc73c\ub85c \uc774\ub8e8\uc5b4\uc9c4(feed sample\uc744 \uc751\uc6a9\ud55c) \uc0d8\ud50c\uc744 \ub9cc\ub4e4\uc5b4\uc11c \uc2e4\ud589\uae4c\uc9c0\ub294 \uc5b4\ub5bb\uac8c\ub4e0 \ud574 \ubcfc \uc218 \uc788\uc9c0\ub9cc extjs\ub97c \uc774\uc6a9\ud55c \ubaa8\ub4e0 \ucf54\ub529\uc774 \uc774\ub807\uac8c \ud558\ub4dc\ucf54\ub529\uc73c\ub85c\ub9cc \uc774\ub8e8\uc5b4\uc9c4\ub2e4\uba74 \ubcf5\uc7a1\ud55c \ub514\ubc84\uae45\uacfc \ub05d\uc5c6\uc774 \ubc18\ubcf5\ub418\ub294 bracket([,{,},]) \ub4e4 \ub54c\ubb38\uc5d0 \ub354\uc774\uc0c1 \uccd0\ub2e4\ubcf4\uace0 \uc2f6\uc9c0\ub3c4 \uc54a\uac8c \ub41c\ub2e4.<\/p>\n<p>\uc544\ubb34\ub798\ub3c4 \ucf54\ub4dc\ub97c \uc815\ub9ac\ud558\uace0 \ubaa8\ub4c8\ub85c \ucabc\uac1c\ub294 \uac83\uc774 \uc88b\uaca0\ub2e4. \ubaa8\ub4c8\ub85c \ucabc\uac1c\uae30 \uc704\ud574\uc11c\ub294 \uc544\ubb34\ub798\ub3c4 \uae30\ub2a5\uc801\uc73c\ub85c\ub098 \ud615\ud0dc\uc801\uc73c\ub85c \ubc18\ubcf5\ub418\ub294 \ubd80\ubd84\uc744 \uc798 \uad6c\ubd84\ud558\uace0 \uc804\uccb4\uc801\uc778 \ud615\ud0dc\ub97c \ud568\uc218 \ud638\ucd9c \ud615\ud0dc\ub85c \uad6c\uc131\ud558\ub294 \uac83\uc774 \uac00\uc7a5 \uc26c\uc6b4 \ubc29\ubc95\uc774\ub2e4. \uadf8\ub7ec\ub098 \uc9c0\ub098\uce5c \ud568\uc218\ud654\ub294 \uc790\uce6b \ud30c\ud3b8\ud654\ub97c \uc77c\uc73c\ucf1c \uc624\ud788\ub824 \uc804\uccb4\uc801\uc778 \ud750\ub984\uc744 \ubc29\ud574\ud560 \uc218\ub3c4 \uc788\uc73c\ubbc0\ub85c \uac04\ub2e8\ud55c \uc218\uc900\uc758 \ud568\uc218\ud654\ub97c \uc9c4\ud589\ud558\ub3c4\ub85d \ud558\uc790.<\/p>\n<p>ExtJs\ub294 \ud654\uba74\uc5d0\uc11c \uc2e4\ud589\ub418\ub294 client side script\uc784\uc744 \uc5ec\ub7ec\ucc28\ub840 \uac15\uc870\ud588\ub294\ub370 \ud654\uba74\uc774 \uc774\ubbf8 script \uc5b8\uc5b4\uc774\ubbc0\ub85c \uc774\ub97c \ub2e4\uc2dc \ubaa8\ub4c8\ud654\ud558\uc5ec \ud568\uc218\ub85c \ubb36\ub294 \ubd80\ubd84\uc740 \uadf8\ub807\uac8c \ud070 \ud6a8\uc6a9\uc131\uc774 \uc5c6\ub2e4. \ubb3c\ub860 \ub2e8\uc21c \ubc18\ubcf5\uc801\uc778 \uc791\uc5c5\uc740 \ub2f9\uc5f0\ud788 \ud568\uc218\ub85c \uad6c\ud604\ud558\ub294 \uac83\uc774 \uc88b\uc73c\uba70 \uc18c\uc2a4\uc758 \ud06c\uae30\uac00 \uc791\uc73c\uba74 \ub85c\ub529 \uc18d\ub3c4\uc640 \uc2e4\ud589\uc18d\ub3c4\uc5d0\uc11c \uc57d\uac04\uc758 \uc774\ub4dd\uc774 \uc788\uaca0\uc9c0\ub9cc \uac1c\ubc1c\uc790\uc758 \uc785\uc7a5\uc5d0\uc11c\ub294 \uc544\uc8fc \ubbf8\uc138\ud55c \ub85c\ub529 \uc18d\ub3c4\ubcf4\ub2e4\ub294 \uac1c\ubc1c\uacfc \ub514\ubc84\uae45\uc758 \ud3b8\uc758\uc131\uc774 \ud6e8\uc52c \uc911\uc694\ud558\ub2e4.<br \/>\n\uadf8\ub798\uc11c, Server side script\uc5d0\uc11c \ud654\uba74 \ubd80\ubd84\uc744 \ubaa8\ub4c8\ub85c \uc815\ub9ac\ud558\uae30\ub85c \ud588\ub2e4.<\/p>\n<p>\uc6b0\uc120 \uc55e\uc5d0\uc11c \uc124\uba85\ud55c \uc608\uc81c\ub97c php \uc5b8\uc5b4\ub85c \uc7ac\uc791\uc131\ud558\uc600\ub2e4.<\/p>\n<pre>index.php\r\n&lt;?php\r\n\/\/ session \ucc98\ub9ac\uc640 login \ucc98\ub9ac \r\n...\r\n\/\/ db\ub97c \uc704\ud55c \ubd80\ubd84\r\n     include 'lib\/mysql.php';\r\n     include 'lib\/check_user.php';\r\n\/\/\r\n?&gt;\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;meta http-equiv=\"X-UA-Compatible\" content=\"IE=7\"&gt; &lt;title&gt;F-square&lt;\/title&gt; \r\n&lt;meta http-equiv=\"Content-Type\" content=\"text\/html; charset=UTF-8\" \/&gt; \r\n&lt;meta http-equiv=\"expires\" content=\"0\" \/&gt; \r\n&lt;meta http-equiv=\"Cache-control\" content=\"no-cache\" \/&gt; \r\n&lt;meta http-equiv=\"Cache-control\" content=\"max-age=0\" \/&gt; \r\n&lt;meta http-equiv=\"pragma\" content=\"no-cache\" \/&gt;\r\n&lt;!-- \uc801\uc6a9\ub41c \ud14c\ub9c8 \uc678\uc5d0 \ucd94\uac00\uc801\uc778 style\uc815\uc758\ub97c \ubaa8\uc544 \ub193\uc740 sheet --&gt;\r\n&lt;link rel=\"stylesheet\" type=\"text\/css\" href=\".\/design\/css\/menu_blue.css\" media=\"screen\" \/&gt;\r\n\r\n&lt;!-- extjs \ud575\uc2ec library --&gt;\r\n&lt;script type=\"text\/javascript\" src=\".\/js\/include-ext.js\"&gt;&lt;\/script&gt; \r\n\r\n&lt;script type=\"text\/javascript\" src=\".\/js\/options-toolbar.js\"&gt;&lt;\/script&gt;\r\n\r\n&lt;script type=\"text\/javascript\" src=\".\/js\/lib.js\"&gt;&lt;\/script&gt;\r\n&lt;?\r\n      include 'js\/tree-menu.php';\r\n      $conn_db = mysql_connect();\r\n?&gt;\r\n\r\n&lt;style type=\"text\/css\"&gt;\r\n\/\/ style, icon class\ub4f1 \ucd94\uac00\r\n&lt;\/style&gt;\r\n\r\nExt.onReady(function() {\r\n    Ext.QuickTips.init();\r\n    var viewport = Ext.create('Ext.Viewport', {\r\n    id: 'border-example',\r\n    layout: 'border',\r\n    items: [\r\n        \/\/ create instance immediately\r\n        Ext.create('Ext.Component', {\r\n            region: 'north',      \/\/ \ud654\uba74\uc758 \ubd81\ucabd(\uc717\ucabd)\uc5d0 \uc704\uce58\r\n            height: 58, \/\/ give north and south regions a height \r\n            autoEl: {\r\n                tag: 'div'\r\n            }\r\n        }), {\r\n\r\n            \/\/ lazily created panel (xtype:'panel' is default)\r\n            region: 'south',  \/\/ \ud654\uba74\uc758 \ub0a8\ucabd(\uc544\ub7ab\ucabd)\uc5d0 \uc704\uce58\ud558\ub294 panel\r\n            contentEl: 'south', \/\/ div id='south'\ub77c\uace0 \ud558\ub294 content\ub97c overriding\ud568\r\n            split: true,  \/\/ \ud06c\uae30\uc870\uc815\uc774 \uac00\ub2a5\ud55c split\r\n            height: 70,\r\n            minSize: 100,\r\n            maxSize: 200,\r\n            collapsible: true,\r\n            collapsed: true,\r\n            title: 'Ticker',\r\n            margins: '0 0 0 0'\r\n        },\r\n\r\n        {\r\n            region: 'west',            \/\/ \ud654\uba74\uc758 \uc11c\ucabd(\uc67c\ucabd)\uc5d0 \uc704\uce58\r\n            stateId: 'navigation-panel',\r\n            id: 'west-panel', \/\/ see Ext.getCmp() below\r\n            title: 'Menu',\r\n            split: true,  \/\/ \ud06c\uae30\uc870\uc815\uc774 \uac00\ub2a5\ud55c split\r\n            width: 200,\r\n            minWidth: 175,\r\n            maxWidth: 400,\r\n            collapsible: true,  \/\/ \ub2eb\ud798 \uae30\ub2a5\uc774 \uac00\ub2a5\r\n            animCollapse: true,  \/\/ \ub2eb\ud790\ub54c \uc560\ub2c8\uba54\uc774\uc158 \uc801\uc6a9\r\n            margins: '0 0 0 5',\r\n            layout: 'accordion',  \/\/ accordion layout\uc73c\ub85c \ud0ed\ub4e4\uc774 \uc874\uc7ac\r\n            items: [\r\n&lt;?\r\n      drawTreeMenu('favorit', $conn_db);\r\n?&gt;\r\n                     ,\r\n&lt;?\r\n      drawTreeMenu('main_menu', $conn_db);\r\n?&gt;\r\n                    , \r\n&lt;?\r\n      drawTreeMenu('config', $conn_db);\r\n?&gt;\r\n\r\n            ]\r\n        },\r\n\r\n        Ext.create('Ext.tab.Panel', {   \/\/ \ud654\uba74\uc758 \uac00\uc6b4\ub370 tab panel\uc0dd\uc131 (mainpanel\uc774\ub77c\uace0 \uba85\uba85)\r\n            region: 'center', \/\/ a center region is ALWAYS required for border layout\r\n            deferredRender: false,\r\n            bodyStyle: 'background-size:contain; background-image:url(http:\/\/www.nyewall.com\/images\/2013\/07\/background-flowers-sky-wallpaper-blue-nice-wallpapers.jpg);',\r\n            id: 'MainPanel',\r\n            activeTab: 0 \/\/ first tab initially active\r\n        })]\r\n    });\r\n\r\n    \/\/ get a reference to the HTML element with id \"hideit\" and add a click listener to it\r\n    Ext.get(\"hide-it\").on('click', function(){\r\n        var w = Ext.getCmp('west-panel');\r\n        w.collapsed ? w.expand() : w.collapse();\r\n    });\r\n});\r\n&lt;\/script&gt;\r\n\r\n&lt;body bgcolor=\"#F0F0FF\" \/* onload=reqeustFullScreen();*\/&gt;\r\n&lt;table width=100% border=0 cellpadding=0 cellspacing=0 &gt;\r\n&lt;tr&gt;&lt;td align=left width=145 class=\"logo\"&gt;AMS&lt;\/td&gt;&lt;td align=left class=\"logo\"&gt;&lt;\/td&gt;&lt;\/tr&gt;\r\n&lt;tr&gt;&lt;td align=left width=145 class=\"logo_under\"&gt;&amp;nbsp; Management System&lt;\/td&gt;&lt;td class=\"logo_under\"&gt;- AMS Consulting&lt;\/td&gt;&lt;\/tr&gt;\r\n&lt;\/table&gt;\r\n\r\n&lt;!-- use class=\"x-hide-display\" to prevent a brief flicker of the content --&gt;\r\n&lt;div id=\"west\" class=\"x-hide-display\"&gt;\r\n&lt;p&gt;west panel&lt;\/p&gt;\r\n&lt;\/div&gt;\r\n&lt;div id=\"center2\" class=\"x-hide-display\"&gt;\r\n&lt;a id=\"hide-it\" href=\"#\"&gt; &lt;\/div&gt;\r\n&lt;div id=\"center1\" class=\"x-hide-display\"&gt;\r\n&lt;\/div&gt;\r\n&lt;\/div&gt;\r\n&lt;div id=\"south\" class=\"x-hide-display\"&gt;\r\n&lt;p&gt;\uc815\uc0c1\uc0c1\ud0dc&lt;\/p&gt;\r\n&lt;\/div&gt;\r\n&lt;br\/&gt;<\/pre>\n<p>\uc774\uc81c index.php\uac00 \uc870\uae08 \uac04\ub2e8\ud558\uac8c \uc904\uc5b4\ub4e4\uc5c8\ub2e4. \ucd94\uac00\ub85c \uc218\uc815\ud574\uc57c \ud558\ub294 \ubd80\ubd84\uc740 drawTreeMenu\ub97c \uad6c\uc131\ubd80\ubd84\uc774\ub2e4. php\uc758 \uc7a5\uc810 \uc911 \ud558\ub098\uac00 \ud568\uc218 \ub0b4\uc5d0 html \ud14d\uc2a4\ud2b8\ub97c \uc784\uc758\ub85c \uc0bd\uc785\ud560 \uc218 \uc788\uace0 \ubb38\ubc95 \uccb4\ud06c\uac00 \ub35c \uc5c4\uaca9\ud558\ub2e4\ub294 \ubd80\ubd84\uc73c\ub85c \ube44\uc2b7\ud55c \uae30\ub2a5\uc73c\ub85c \ube44\uad50\ub300\uc0c1\uc774 \ub418\uace4 \ud558\ub294 jsp\ub85c \uad6c\uc131\ud558\ub294 \uacbd\uc6b0\uc640\ub294 \uc57d\uac04 \ucc28\uc774\uac00 \ub09c\ub2e4(jsp\ub85c\ub3c4 \uad6c\uc131\uc740 \uac00\ub2a5\ud558\ub098 \uc77c\ubd80 \ubcc0\uacbd\uc791\uc5c5\uc774 \ud544\uc694\ud558\ub2e4).<\/p>\n<pre>js\/tree-menu.php\r\n&lt;?php\r\nfunction drawTreeMenu( $title, $dbconn )\r\n{\r\n     \/\/ \ubcf4\uc548\uc744 \uc704\ud574 \ucd94\uac00\uc801\uc778 session check\uc640\r\n     \/\/ theme, cookie \ub4f1\uc744 \uccb4\ud06c\r\n\r\n     if ( $title == 'main_menu') {\r\n        $str_id = 'Fund-manager';\r\n        $icon   = 'info';\r\n        $cond_clause = 'user_level &lt;= menu_level ';\r\n    }\r\n    else if ( $title == 'favorit' ) {\r\n        $str_id = 'favorit';\r\n        $icon   = 'nav';\r\n        $cond_clause = 'favorit = true';\r\n    }\r\n?&gt;\r\n       {\r\n        title: '\uc990\uaca8\ucc3e\uae30',\r\n        xtyle: 'treepanel',\r\n        id: '&lt;=$str_id&gt;',\r\n        iconCls: '&lt;=$icon&gt;',\r\n        margins: '2 2 0 2',\r\n        autoScroll: true,\r\n        ...\r\n        root:{ text: \"Root Node\",\r\n              children: [\r\n&lt;?\r\n                 \/\/ \uba54\ub274\ub97c \uc870\ud68c\ud558\uae30 \uc704\ud55c query\ubb38\r\n                 $sql = \"SELECT menu_title, menu_num, leaf \";\r\n                 $sql.= \"FROM menu_table \";\r\n                 $sql.= \"WHERE use_yn = 'Y'  \";\r\n                 $sql.= $cond_clause;\r\n                 ...\r\n                 menu\ub97c \ud654\uba74\uc5d0 \ucd9c\ub825\ud558\ub294 \ubd80\ubd84\r\n?&gt; \r\n              ]\r\n          },\r\n          listeners: {\r\n                itemclick: function(s,d) {\r\n                 ...\r\n          }\r\n       }\r\n&lt;?\r\n}\r\n?&gt;<\/pre>\n<p>php\ub85c extjs\uc758 \ubcf5\uc7a1\ud568\uc744 \uc904\uc774\uae30\ub294 \uc5ed\ubd80\uc871\uc774\ub2e4. \uadf8\ub7ec\ub098, Style sheet\ub97c \uc798 \uc815\uc758\ud558\uace0 \ubc18\ubcf5\uc801\uc778 \ucef4\ud3ec\ub10c\ud2b8 \ud638\ucd9c (chart, grid \ub4f1)\ubd80\ubd84\uc744 function\uc73c\ub85c \ubd84\ub9ac\ud558\uae30\ub9cc \ud574\ub3c4 \ub514\ubc84\uadf8\uc640 \ud654\uba74 \uac1c\ubc1c\uc774 \ud6e8\uc52c \uc26c\uc6cc\uc9c4\ub2e4.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\uccab\ubc88\uc9f8 \ubcf5\ud569 frame\uc73c\ub85c \uc774\ub8e8\uc5b4\uc9c4(feed sample\uc744 \uc751\uc6a9\ud55c) \uc0d8\ud50c\uc744 \ub9cc\ub4e4\uc5b4\uc11c \uc2e4\ud589\uae4c\uc9c0\ub294 \uc5b4\ub5bb\uac8c\ub4e0 \ud574 \ubcfc \uc218 \uc788\uc9c0\ub9cc extjs\ub97c \uc774\uc6a9\ud55c \ubaa8\ub4e0 \ucf54\ub529\uc774 \uc774\ub807\uac8c \ud558\ub4dc\ucf54\ub529\uc73c\ub85c\ub9cc \uc774\ub8e8\uc5b4\uc9c4\ub2e4\uba74 \ubcf5\uc7a1\ud55c \ub514\ubc84\uae45\uacfc \ub05d\uc5c6\uc774 \ubc18\ubcf5\ub418\ub294 bracket([,{,},]) \ub4e4 \ub54c\ubb38\uc5d0 \ub354\uc774\uc0c1 \uccd0\ub2e4\ubcf4\uace0 \uc2f6\uc9c0\ub3c4 \uc54a\uac8c \ub41c\ub2e4. \uc544\ubb34\ub798\ub3c4 \ucf54\ub4dc\ub97c \uc815\ub9ac\ud558\uace0 \ubaa8\ub4c8\ub85c \ucabc\uac1c\ub294 \uac83\uc774 \uc88b\uaca0\ub2e4. \ubaa8\ub4c8\ub85c \ucabc\uac1c\uae30 \uc704\ud574\uc11c\ub294 \uc544\ubb34\ub798\ub3c4 \uae30\ub2a5\uc801\uc73c\ub85c\ub098 \ud615\ud0dc\uc801\uc73c\ub85c \ubc18\ubcf5\ub418\ub294 \ubd80\ubd84\uc744 \uc798 \uad6c\ubd84\ud558\uace0 \uc804\uccb4\uc801\uc778 \ud615\ud0dc\ub97c \ud568\uc218 \ud638\ucd9c \ud615\ud0dc\ub85c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[],"class_list":["post-127","post","type-post","status-publish","format-standard","hentry","category-extjs"],"_links":{"self":[{"href":"https:\/\/www.fsquare.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/127","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fsquare.co.kr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fsquare.co.kr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fsquare.co.kr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fsquare.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=127"}],"version-history":[{"count":4,"href":"https:\/\/www.fsquare.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/127\/revisions"}],"predecessor-version":[{"id":131,"href":"https:\/\/www.fsquare.co.kr\/index.php?rest_route=\/wp\/v2\/posts\/127\/revisions\/131"}],"wp:attachment":[{"href":"https:\/\/www.fsquare.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fsquare.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=127"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fsquare.co.kr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}