{"id":3874,"date":"2014-12-04T18:41:50","date_gmt":"2014-12-04T09:41:50","guid":{"rendered":"https:\/\/gunmagisgeek.com\/wordpress\/?p=3874"},"modified":"2019-01-11T14:53:35","modified_gmt":"2019-01-11T05:53:35","slug":"post-3874","status":"publish","type":"post","link":"https:\/\/gunmagisgeek.com\/blog\/webix\/3874","title":{"rendered":"[Webix]List\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u5165\u9580"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"http:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2014\/12\/webixlist141204.jpg\" alt=\"webix list view\" width=\"509\" height=\"473\" class=\"aligncenter size-full wp-image-3882 border\" srcset=\"https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2014\/12\/webixlist141204.jpg 509w, https:\/\/gunmagisgeek.com\/blog\/wp-content\/uploads\/2014\/12\/webixlist141204-161x150.jpg 161w\" sizes=\"auto, (max-width: 509px) 100vw, 509px\" \/><\/p>\n<p><a href=\"https:\/\/qiita.com\/advent-calendar\/2014\/webix\">Webix Advent Calendar 2014<\/a> \uff14\u65e5\u76ee\u306e\u8a18\u4e8b\u3067\u3059\u3002<\/p>\n<p>\u6628\u65e5\u306f\u7a81\u7136\u904e\u53bb\u3092\u632f\u308a\u8fd4\u308a\u305f\u304f\u306a\u3063\u3066<a href=\"https:\/\/gunmagisgeek.com\/blog\/analytics\/3861\">\u5225\u306e\u8a18\u4e8b<\/a>\u3092\u66f8\u3044\u3066\u3044\u305f\u305f\u3081\u304a\u4f11\u307f\u3057\u307e\u3057\u305f\u3002<\/p>\n<p>\u3055\u3066\u3001\u4eca\u56de\u306fWebix\u306eList\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u3092\u4f7f\u3063\u3066\u307f\u307e\u3059\u3002<br \/>\nWebix\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306fJavaScript\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3068\u3057\u3066\u5fc5\u8981\u306a\u8981\u7d20\u3092\u6307\u5b9a\u3057\u3066webix.ui\u306b\u6e21\u3057\u3066\u3042\u3052\u308c\u3070\u3001\u5f8c\u306fWebix\u304c\u826f\u3044\u611f\u3058\u306b\u8868\u793a\u3057\u3066\u304f\u308c\u307e\u3059\u3002<\/p>\n<h2>\u30ea\u30b9\u30c8\u306e\u8868\u793a<\/h2>\n<p>\u57fa\u672c\u7684\u306b\u306f\u3001view\u30d7\u30ed\u30d1\u30c6\u30a3\u3067&#8221;list&#8221;\u3092\u6307\u5b9a\u3057\u3001data\u30d7\u30ed\u30d1\u30c6\u30a3\u306b\u30ea\u30b9\u30c8\u3068\u3057\u3066\u8868\u793a\u3057\u305f\u3044\u30c7\u30fc\u30bf(JSON)\u3092\u6e21\u3057\u3066templete\u5185\u3067\u8868\u793a\u3059\u308b\u5185\u5bb9\u306e\u66f8\u5f0f\u3092\u8a2d\u5b9a\u3059\u308c\u3070\u30ea\u30b9\u30c8\u3068\u3057\u3066\u8868\u793a\u3055\u308c\u307e\u3059\u3002<br \/>\ntemplate\u306e\u4e2d\u3067\u306f\u300c#key\u540d#\u300d\u3067\u6e21\u3057\u305f\u30c7\u30fc\u30bf\u306e\u5024\u3092\u8868\u793a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002\u307e\u305fHTML\u30bf\u30b0\u3082\u6307\u5b9a\u53ef\u80fd\u3067\u3059\u3002<br \/>\n\uff08\u306a\u304a\u30ea\u30b9\u30c8\u306b\u6e21\u3057\u3066\u3044\u308btestData\u306ftestData.js\u5185\u3067\u5ba3\u8a00\u3057\u5916\u90e8\u30b9\u30af\u30ea\u30d7\u30c8\u3068\u3057\u3066\u8aad\u307f\u8fbc\u3093\u3067\u3044\u307e\u3059\u3002\u30c7\u30fc\u30bf\u306e\u5185\u5bb9\u306f\u4ee5\u4e0b\u3092\uff09<\/p>\n<p><a href=\"https:\/\/shimz.me\/example\/webix\/list\/testData.js\">testData.js<\/a><\/p>\n<pre class=\"lang:js decode:true \" >\/\/console.log(testData); \/\/\u30c6\u30b9\u30c8\u7528\u30c7\u30fc\u30bf\n\nwebix.ui({\n    view:\"list\",\n    template:\"#pref#. - \u4eba\u53e3#people#\u4eba\", \/\/\u66f8\u5f0f\u6307\u5b9a\n    select:\"multiselect\",       \/\/\u884c\u3092\u9078\u629e\u53ef\u80fd\u306b\u3059\u308b(\u8907\u6570\u9078\u629e\u53ef)\n    data:testData   \/\/\u30ea\u30b9\u30c8\u3067\u8868\u793a\u3059\u308b\u30c7\u30fc\u30bf\n});<\/pre>\n<p><iframe loading=\"lazy\" width=\"200\" height=\"300\" scrolling=\"no\" src=\"https:\/\/shimz.me\/example\/webix\/list\/01\/\"><\/iframe><\/p>\n<p><a href=\"https:\/\/shimz.me\/example\/webix\/list\/01\/\">example<\/a><\/p>\n<h2>Horizontal\u30ea\u30b9\u30c8<\/h2>\n<p>\u30ea\u30b9\u30c8\u30d3\u30e5\u30fc\u3067\u306f\u30ec\u30a4\u30a2\u30a6\u30c8\u65b9\u5411\u3068\u30b9\u30af\u30ed\u30fc\u30eb\u65b9\u5411\u3092\u300cx\u8ef8\u300d\u306b\u6307\u5b9a\u3059\u308b\u3053\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n<pre class=\"lang:js decode:true \" >webix.ui({\n    view:\"list\",\n    height:60, \/\/\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u5168\u4f53\u306e\u9ad8\u3055\n    width:700, \/\/\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u5168\u4f53\u306e\u5e45\n    scroll:\"x\", \/\/x\u8ef8\u306b\u30b9\u30af\u30ed\u30fc\u30eb\n    layout:\"x\", \/\/x\u8ef8\u306b\u30ec\u30a4\u30a2\u30a6\u30c8\u3057\u3066\u8868\u793a\n    select:true,\n    type:{\n        height:60, \/\/\u5404\u30a2\u30a4\u30c6\u30e0\u306e\u9ad8\u3055\n        width:170  \/\/\u5404\u30a2\u30a4\u30c6\u30e0\u306e\u5e45\n    },\n    template:\"#pref# &lt;br&gt; \u4eba\u53e3#people#\u4eba\", \/\/\u66f8\u5f0f\u6307\u5b9a\n    data:testData\n});<\/pre>\n<p><iframe loading=\"lazy\" width=\"100%\" height=\"77\" scrolling=\"no\" src=\"https:\/\/shimz.me\/example\/webix\/list\/HorizontalLists\/\"><\/iframe><\/p>\n<p><a href=\"https:\/\/shimz.me\/example\/webix\/list\/HorizontalLists\/\">example<\/a><\/p>\n<h2>\u30b0\u30eb\u30fc\u30d4\u30f3\u30b0<\/h2>\n<p>grouplist\u30d3\u30e5\u30fc\u3092\u5229\u7528\u3059\u308b\u3068\u3001\u6e21\u3057\u305f\u30c7\u30fc\u30bf\u306e\u7279\u5b9a\u306e\u9805\u76ee\u3092\u5143\u306b\u30b0\u30eb\u30fc\u30d4\u30f3\u30b0\u3057\u3066\u30ea\u30b9\u30c8\u3092\u8868\u793a\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n\u3053\u306e\u6a5f\u80fd\u3092\u5229\u7528\u3059\u308b\u3068\u30e2\u30d0\u30a4\u30eb\u5411\u3051\u306e\u30b9\u30e9\u30a4\u30c9\u30e1\u30cb\u30e5\u30fc\u306a\u3069\u304c\u7c21\u5358\u306b\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\n(\u30bf\u30c3\u30c1\u30a4\u30d9\u30f3\u30c8\u306b\u3082\u5bfe\u5fdc\u3057\u3066\u3044\u307e\u3059\uff09<\/p>\n<pre class=\"lang:js decode:true \" >webix.ui({\n    view:\"grouplist\",  \/\/grouplist\u30d3\u30e5\u30fc\u3092\u6307\u5b9a\n    templateBack:\"\u623b\u308b\",\n    templateGroup:\"#value#\",\u3000\/\/\u30b0\u30eb\u30fc\u30d4\u30f3\u30b0\u5bfe\u8c61\u3068\u3057\u305f\u30ad\u30fc\u306e\u5024\u3092\u8868\u793a\u6307\u5b9a\n    templateItem:\"#pref# - \u4eba\u53e3#people#\u4eba\", \/\/\u30b0\u30eb\u30fc\u30d7\u9078\u629e\u5f8c\u306b\u8868\u793a\u6307\u5b9a\n    select:true,\n    scheme:{\n        $group:{\n            by:'group' \/\/\u30b0\u30eb\u30fc\u30d4\u30f3\u30b0\u5bfe\u8c61\u3068\u3059\u308b\u30ad\u30fc\u3092\u6307\u5b9a\n        },\n        $sort:{ by:\"value\", dir:\"desc\" } \/\/\u30b0\u30eb\u30fc\u30d4\u30f3\u30b0\u3057\u305f\u30ad\u30fc\u306e\u5024\u3067\u30bd\u30fc\u30c8\n    },\n    data:testData\n});<\/pre>\n<p><iframe loading=\"lazy\" width=\"200\" height=\"300\" scrolling=\"no\" src=\"https:\/\/shimz.me\/example\/webix\/list\/grouping\/\"><\/iframe><\/p>\n<p><a href=\"https:\/\/shimz.me\/example\/webix\/list\/grouping\/\">example<\/a><\/p>\n<h2>\u30ea\u30b9\u30c8\u306e\u30b9\u30bf\u30a4\u30ea\u30f3\u30b0<\/h2>\n<p>\u30ea\u30b9\u30c8\u30d3\u30e5\u30fc\u3067\u306ftype\u30d7\u30ed\u30d1\u30c6\u30a3\u5185\u3067\u5404item\u306e\u30b9\u30bf\u30a4\u30eb\u306a\u3069\u3092\u30ab\u30b9\u30bf\u30de\u30a4\u30ba\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<br \/>\ntemplate\u5185\u3067\u4f7f\u7528\u3059\u308b\u3001\u30ab\u30b9\u30bf\u30e0\u5909\u6570\u306a\u3069\u306e\u8a2d\u5b9a\u3082type\u30d7\u30ed\u30d1\u30c6\u30a3\u306e\u4e2d\u3067\u884c\u3048\u307e\u3059\u3002<\/p>\n<pre class=\"lang:js decode:true \" >\n\/\/\u30ab\u30fc\u30c9\u3063\u307d\u3044\u30ea\u30b9\u30c8\nvar listA = {\n    view:\"list\",\n    type:{\n        templateStart:\"&lt;div class='custom_item'&gt;\",\u3000\/\/\u5404item\u3092\u5305\u3080\u8981\u7d20\u3092\u6307\u5b9a\n        template:\"#pref#&lt;br&gt;&lt;div style='text-align:right;'&gt;#group#&lt;\/div&gt;\",\n        templateEnd:\"&lt;\/div&gt;\" \/\/\u5404\u30a2\u30a4\u30c6\u30e0\u3092\u5305\u3080\u8981\u7d20\u306e\u30a8\u30f3\u30c9\u30bf\u30b0\u7b49\u3092\u6307\u5b9a\n    },\n    data:testData\n}\n\n\/\/\u30c7\u30fc\u30bf\u306e\u5024\u306b\u5fdc\u3058\u3066\u30b9\u30bf\u30a4\u30eb\u3092\u5909\u66f4\u3059\u308b\u30ea\u30b9\u30c8\nvar listB = {\n    view:\"list\",\n    template:\"{common.itemIcon} #pref# {common.itemPopulation()}\", \/\/type\u5185\u3067\u8a2d\u5b9a\u3057\u305f\u30ab\u30b9\u30bf\u30e0\u5909\u6570\u3092\u5229\u7528\n    type:{\n        itemIcon:\"&lt;span class='webix_icon fa-map-marker'&gt;&lt;\/span&gt;\", \/\/\u30a2\u30a4\u30b3\u30f3\u3092\u6307\u5b9a\n        itemPopulation:function(obj){ \/\/\u30ab\u30b9\u30bf\u30e0\u5909\u6570\u3000\u4eba\u53e3\u5bc6\u5ea6\u306b\u3088\u3063\u3066\u6587\u5b57\u30ab\u30e9\u30fc\u3092\u5909\u3048\u3066\u3044\u308b\n            if(+obj.population&gt;=1000){\n                return \"&lt;div class='mark red'&gt;\"+obj.population+\"&lt;\/div&gt;\";\n            } else if(+obj.population&lt;100){\n                return \"&lt;div class='mark blue'&gt;\"+obj.population+\"&lt;\/div&gt;\";\n            } else\n                return \"&lt;div class='mark'&gt;\"+obj.population+\"&lt;\/div&gt;\";\n        }\n    },\n    select:true,\n    data:testData\n}\n\n\/\/\u30ec\u30a4\u30a2\u30a6\u30c8\u3059\u308b\nwebix.ui({\n    cols:[listA, listB] \/\/\u30ea\u30b9\u30c8A\u3068\u30ea\u30b9\u30c8B\u3092\u6a2a\u306b\u4e26\u3079\u3066\u8868\u793a\n});<\/pre>\n<p><iframe loading=\"lazy\" width=\"100%\" height=\"300\" scrolling=\"no\" src=\"https:\/\/shimz.me\/example\/webix\/list\/styling\/\"><\/iframe><\/p>\n<h2>\u5099\u8003<\/h2>\n<p>webix\u306e\u30b3\u30f3\u30dd\u30fc\u30cd\u30f3\u30c8\u306f\u4e00\u3064\u4e00\u3064\u304c\u975e\u5e38\u306b\u591a\u6a5f\u80fd\u306a\u305f\u3081\u3001\u5168\u3066\u306e\u5229\u7528\u6cd5\u3092\u304a\u4f1d\u3048\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u305b\u3093\u3002<br \/>\n\u516c\u5f0f\u30b5\u30a4\u30c8\u306b\u975e\u5e38\u306b\u5145\u5b9f\u3057\u305f\u30b5\u30f3\u30d7\u30eb\u3068\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u304c\u516c\u958b\u3055\u308c\u3066\u3044\u307e\u3059\u306e\u3067\u3001\u8208\u5473\u306e\u3042\u308b\u65b9\u306f\u305d\u3061\u3089\u3092\u53c2\u7167\u3057\u3066\u307f\u3066\u304f\u3060\u3055\u3044\u3002<\/p>\n<p><a href=\"https:\/\/docs.webix.com\/desktop__list.html\">document<\/a><br \/>\n<a href=\"https:\/\/docs.webix.com\/samples\/05_list\/index.html\">sample<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Webix Advent Calendar 201&hellip;<\/p>\n","protected":false},"author":1,"featured_media":3882,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[58],"tags":[],"class_list":["post-3874","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\/3874","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=3874"}],"version-history":[{"count":0,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/posts\/3874\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media\/3882"}],"wp:attachment":[{"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/media?parent=3874"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/categories?post=3874"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/gunmagisgeek.com\/blog\/wp-json\/wp\/v2\/tags?post=3874"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}