"use json!v7/veldoffice/codering/locales/nl_NL"; ["Container", [ ["Bar", [ // ["vcl-ui:Select", { // value: null, // options: Object.keys(immetingen) // .sort() // .filter(function(key) { // return key.startsWith("sikb."); // }) // .map(function(key) { // return key.split(".").pop().split("_")[0]; // }), // onChange: function() { // this.up().qs("#array").setArray(table(this.getValue()) || []); // } // }] ["Input", "search-input", { onChange: function() { var me = this, scope = me.scope(); function filter(object) { var values = me.getInputValue().toLowerCase().trim().split(" "); var or = values.some(function(value) { return Object.keys(object).some(function(key) { return (""+object[key]).toLowerCase().indexOf(value) !== -1; }); }); var and = values.every(function(value) { return Object.keys(object).some(function(key) { return (""+object[key]).toLowerCase().indexOf(value) !== -1; }); }); return !and; } this.setTimeout("change", function() { var value = me.getInputValue(); scope.array.setOnFilterObject(!value.length ? null : filter); }, 200); } }] ]], ["List", { autoColumns: true, source: "array", onDblClick: function() { var selection = this.getSelection(true), msg; if(selection.length) { if(selection.length === 1) { selection = selection[0]; msg = String.format("%s:%d", selection.entity, selection.veldofficeId); } else { msg = String.format("%d items", selection.length); } this.up("devtools/Workspace<>").print(msg, selection); } } }], ["Array", "array", { onLoad: function() { var codes = require("json!v7/veldoffice/codering/locales/nl_NL"); var all = []; for(var entity in codes) { codes[entity].forEach(function(code) { // for(var key in code.export) { if(code.export.SIKB135) { all.push({ entity: entity, veldofficeId: code.id, codespace: 'SIKB135', code: code.export.SIKB135, __: code }); // } } else { //if(!code.export.SIKB135) { all.push({ entity: entity, veldofficeId: code.id, codespace: "SIKB135", code: "???", omschrijving: code.omschrijving, __: code, }); } }); } this.up().qs("#array").setArray(all); } }] ]];