From 523a4eb6ffaef2dd25782dac5f5e9bc57dc46832 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 18 Jan 2017 13:22:51 +0100 Subject: [PATCH] extractData && formatData --- src/ui/TreeView.js | 58 +++++++++++++++++++++++++++++----------------- 1 file changed, 37 insertions(+), 21 deletions(-) diff --git a/src/ui/TreeView.js b/src/ui/TreeView.js index 49df208ce9..9d830e2c3c 100644 --- a/src/ui/TreeView.js +++ b/src/ui/TreeView.js @@ -10,6 +10,8 @@ class TreeView { } this.beforeJsonNodeRendered = opts.beforeJsonNodeRendered || noop this.beforeJsonValueRendered = opts.beforeJsonValueRendered || noop + this.extractData = opts.extractData || this.extractDataDefault + this.formatData = opts.formatData || this.formatDataDefault this.view = null this.cssLabel = ui.formatCss(opts.css || {}, style.label) this.cssList = ui.formatCss(opts.css || {}, style.list) @@ -34,36 +36,50 @@ class TreeView { } renderObject (item, key, expand) { - var label - if (item instanceof Array || item instanceof Object) { - var properties = this.renderProperties(item, false) - label = yo`` - var list = yo`