From 1d72848b5a2196176fe0d631ec635fbe840f443b Mon Sep 17 00:00:00 2001 From: Kobi Date: Fri, 24 Apr 2020 14:02:06 +0800 Subject: [PATCH 1/2] =?UTF-8?q?KERNEL-3911=20fix:=20=E4=BF=AE=E5=A4=8Ddemo?= =?UTF-8?q?=E4=B8=AD=E6=90=9C=E7=B4=A2=E7=9A=84=E7=BB=93=E6=9E=9C=E6=B2=A1?= =?UTF-8?q?=E6=9C=89=E5=AF=B9=E5=BA=94=E7=9A=84=E5=AD=90=E8=8A=82=E7=82=B9?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/js/west.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/demo/js/west.js b/demo/js/west.js index 2c68f3795..4391ba9c3 100644 --- a/demo/js/west.js +++ b/demo/js/west.js @@ -38,6 +38,16 @@ Demo.West = BI.inherit(BI.Widget, { onSearch: function (op, callback) { var result = BI.Func.getSearchResult(Demo.CONFIG, op.keyword, "text"); var items = result.match.concat(result.find); + var children = []; + BI.each(items, function (index, item) { + var childList = BI.Func.getSearchResult(Demo.CONFIG, item.id, "pId"); + BI.each(childList.match, function (index, child) { + if (child.value) { + children.push(child); + } + }); + }); + items = items.concat(children); callback(items); } }], From 1bb90a1c4dc45761d53578c80696bb8a30af5bb5 Mon Sep 17 00:00:00 2001 From: Kobi Date: Fri, 24 Apr 2020 14:47:35 +0800 Subject: [PATCH 2/2] =?UTF-8?q?KERNEL-3911=20=E7=94=A8BI.concat=E6=9B=BF?= =?UTF-8?q?=E6=8D=A2concat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/js/west.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demo/js/west.js b/demo/js/west.js index 4391ba9c3..d4cc9d59b 100644 --- a/demo/js/west.js +++ b/demo/js/west.js @@ -37,7 +37,7 @@ Demo.West = BI.inherit(BI.Widget, { }, onSearch: function (op, callback) { var result = BI.Func.getSearchResult(Demo.CONFIG, op.keyword, "text"); - var items = result.match.concat(result.find); + var items = BI.concat(result.match, result.find); var children = []; BI.each(items, function (index, item) { var childList = BI.Func.getSearchResult(Demo.CONFIG, item.id, "pId"); @@ -47,7 +47,7 @@ Demo.West = BI.inherit(BI.Widget, { } }); }); - items = items.concat(children); + items = BI.concat(items, children); callback(items); } }],