{"id":3909,"date":"2014-12-10T16:27:54","date_gmt":"2014-12-10T07:27:54","guid":{"rendered":"https:\/\/gunmagisgeek.com\/wordpress\/?p=3909"},"modified":"2019-01-11T15:00:25","modified_gmt":"2019-01-11T06:00:25","slug":"post-3909","status":"publish","type":"post","link":"https:\/\/gunmagisgeek.com\/blog\/webix\/3909","title":{"rendered":"[Webix]\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u9593\u306e\u30c7\u30fc\u30bf\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u5165\u9580"},"content":{"rendered":"<p><a href=\"https:\/\/qiita.com\/advent-calendar\/2014\/webix\">Webix Advent Calendar 2014<\/a> \uff11\uff10\u65e5\u76ee\u306e\u8a18\u4e8b\u3067\u3059\u3002<\/p>\n<p>\u3053\u308c\u307e\u3067\u3001<a href=\"https:\/\/gunmagisgeek.com\/blog\/webix\/3874\">List\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306e\u4f5c\u6210<\/a>\u3084\u3001<a href=\"https:\/\/gunmagisgeek.com\/blog\/webix\/3902\">Form\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u4f7f\u3044\u65b9<\/a>\u3092\u63b2\u8f09\u3057\u3066\u304d\u307e\u3057\u305f\u304c\u3001\u672c\u65e5\u306f\u3053\u306e\u4e8c\u3064\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u9593\u3067\u30c7\u30fc\u30bf\u3092\u675f\u7e1b\u3057\u3001\u7247\u65b9\u3067\u884c\u308f\u308c\u305f\u64cd\u4f5c\u304c\u3082\u3046\u4e00\u65b9\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306b\u53cd\u6620\u3055\u308c\u308b\u3088\u3046\u306b\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>Webix\u3067\u306f\u7c21\u5358\u306b\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u540c\u58eb\u3092\u7d50\u3073\u3064\u3051\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<h2>\u30ea\u30b9\u30c8\u3068\u30d5\u30a9\u30fc\u30e0\u306e\u76f8\u4e92\u4f5c\u7528<\/h2>\n<p>\u30ea\u30b9\u30c8\u3092\u9078\u629e\u3059\u308b\u3068\u9078\u629e\u3055\u308c\u305f\u30a2\u30a4\u30c6\u30e0\u306e\u30c7\u30fc\u30bf\u304c\u30d5\u30a9\u30fc\u30e0\u306b\u53cd\u6620\u3055\u308c\u7de8\u96c6\u3067\u304d\u308b\u3088\u3046\u306b\u3001\u307e\u305f\u30a2\u30a4\u30c6\u30e0\u304c\u9078\u629e\u3055\u308c\u3066\u3044\u306a\u3044\u969b\u306b\u306f\u30d5\u30a9\u30fc\u30e0\u306b\u5165\u529b\u3055\u308c\u305f\u30c7\u30fc\u30bf\u304c\u65b0\u898f\u30a2\u30a4\u30c6\u30e0\u3068\u3057\u3066\u30ea\u30b9\u30c8\u306b\u8ffd\u52a0\u3055\u308c\u308b\u3068\u3044\u3046\u76f8\u4e92\u4f5c\u7528\u306e\u4ed5\u7d44\u307f\u3092\u4f5c\u6210\u3057\u307e\u3059\u3002<\/p>\n<p><iframe loading=\"lazy\" width=\"400\" height=\"500\" scrolling=\"no\" src=\"https:\/\/shimz.me\/example\/webix\/dataBinding\/Lsit_Form\/\"><\/iframe><\/p>\n<p><a href=\"https:\/\/shimz.me\/example\/webix\/dataBinding\/Lsit_Form\/\">example<\/a><\/p>\n<pre class=\"lang:js decode:true \" > \n\/*** \u30ea\u30b9\u30c8\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8***********************************************\/ \nvar LISTDATA = [\n    {last_name:\"\u6e05\u6c34\", first_name: \"\u6b63\u884c\", gender:\"man\" },\n    {last_name:\"\u5c71\u7530\", first_name: \"\u82b1\u5b50\", gender:\"woman\" },\n    {last_name:\"\u9234\u6728\", first_name: \"\u58eb\u90ce\", gender:\"man\"  }\n];\n\n\/\/\u30a2\u30a4\u30c6\u30e0\u9078\u629e\u3092\u5916\u3059\u51e6\u7406\nvar list_unselect = \"$$('list_comp').unselectAll()\";\n\nvar list_component = {\n    rows:[\n        { view:\"button\", value:\"\u9078\u629e\u3057\u306a\u3044\", click:list_unselect},\n        {\n            id: \"list_comp\",\n            view: \"list\",\n            template:\"#last_name# #first_name# - {common.itemGender()}\",\n            select: true,\n            type:{\n                itemGender:function(obj){\n                    switch (obj.gender) {\n                        case \"man\":  return \"\u7537\"; break;\n                        case \"woman\": return \"\u5973\"; break;                            \n                    }\n                }\n            },\n            data:LISTDATA\n        }\n    ]\n};\n\n\n\/*** \u30d5\u30a9\u30fc\u30e0\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8***********************************************\/    \nvar form_save = \"if($$('form_comp').isDirty()) $$('form_comp').save();\";\nvar form_clear = \"$$('form_comp').clear();\";\n\nvar form_component = {\n    id:\"form_comp\",\n    view:\"form\",\n    elements:[\n        { view:\"text\", name:\"last_name\", label:\"\u82d7\u5b57\"},\n        { view:\"text\", name:\"first_name\", label:\"\u540d\u524d\"},\n        { view:\"radio\", name:\"gender\", label:\"\u6027\u5225\",\n            value:\"man\", \/\/\u521d\u671f\u9078\u629e\u5024\n            options:[   \/\/\u9078\u629e\u80a2\n                { value:\"\u7537\", id:\"man\" },\n                { value:\"\u5973\", id:\"woman\" }\n            ]\n        },\n        {cols:[\n            { view: \"button\", label:\"\u4fdd\u5b58\u3059\u308b\", type:\"form\", click:form_save },\n            { view: \"button\", label:\"\u30af\u30ea\u30a2\", click:form_clear },\n        ]}\n    ]\n};\n\n\/*** \u30ec\u30a4\u30a2\u30a6\u30c8***********************************************\/  \nwebix.ui({\n    rows:[\n        list_component,\n        form_component\n    ] \n});\n\n\n\/*** \u30c7\u30fc\u30bf\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0***********************************************\/\n$$('form_comp').bind($$('list_comp'));\n<\/pre>\n<h2>\u675f\u7e1b<\/h2>\n<p>\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u540c\u58eb\u3092\u7d50\u3073\u3064\u3051\u308b\u306e\u306f\u4e0b\u8a18\u306e\u305f\u3063\u305f\u4e00\u884c\u3067\u3059\u307f\u307e\u3059\u3002<\/p>\n<pre class=\"lang:js decode:true \" >$$('form_comp').bind($$('list_comp'));<\/pre>\n<p>\u3053\u308c\u3060\u3051\u3067\u3001\u30ea\u30b9\u30c8\u4e0a\u3067\u30a2\u30a4\u30c6\u30e0\u3092\u9078\u629e\u3057\u305f\u969b\u306b\u30d5\u30a9\u30fc\u30e0\u306b\u30c7\u30fc\u30bf\u304c\u53cd\u6620\u3055\u308c\u3001\u30d5\u30a9\u30fc\u30e0\u5074\u3067\u306f\u3001<\/p>\n<pre class=\"lang:js decode:true \" >$$('form_comp').save();<\/pre>\n<p>\u4e0a\u8a18\u30e1\u30bd\u30c3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3060\u3051\u3067\u30a2\u30a4\u30c6\u30e0\u30c7\u30fc\u30bf\u306e\u7de8\u96c6\uff0f\u8ffd\u52a0\u304c\u30ea\u30b9\u30c8\u3078\u53cd\u6620\u3055\u308c\u307e\u3059\u3002<\/p>\n<h2>\u5099\u8003<\/h2>\n<p>Webix\u306b\u306f\u4ed6\u306b\u3082\u4fbf\u5229\u306a\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u9593\u306e\u30c7\u30fc\u30bf\u30d0\u30a4\u30f3\u30c7\u30a3\u30f3\u30b0\u3084\u30b7\u30f3\u30af(\u540c\u671f)\u306e\u4ed5\u7d44\u307f\u304c\u3042\u308a\u307e\u3059\u306e\u3067\u3001\u8208\u5473\u306e\u3042\u308b\u65b9\u306f\u4e0b\u8a18\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u3092\u3054\u89a7\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><a href=\"http:\/\/docs.webix.com\/desktop__data_binding.html\">Data Binding and Syncing<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Webix Advent Calendar 201&hellip;<\/p>\n","protected":false},"author":1,"featured_media":3910,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58],"tags":[],"class_list":["post-3909","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-webix","has-post-thumbnail-archive"],"_links":{"self":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/3909","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/comments?post=3909"}],"version-history":[{"count":0,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/3909\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media\/3910"}],"wp:attachment":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media?parent=3909"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/categories?post=3909"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/tags?post=3909"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}