From c243d1daf688367c41f8b1420f70025f410117b8 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Thu, 18 Jan 2018 19:23:08 +0800 Subject: [PATCH] =?UTF-8?q?downlistcombo=E7=9A=84getValue=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- demo/js/widget/downlist/demo.downlist.js | 320 +++++++++++++++------- dist/bundle.js | 22 +- dist/demo.js | 322 ++++++++++++++++------- dist/fineui.js | 22 +- dist/widget.js | 22 +- src/widget/downlist/popup.downlist.js | 22 +- 6 files changed, 547 insertions(+), 183 deletions(-) diff --git a/demo/js/widget/downlist/demo.downlist.js b/demo/js/widget/downlist/demo.downlist.js index 8bfaae8da..6456db463 100644 --- a/demo/js/widget/downlist/demo.downlist.js +++ b/demo/js/widget/downlist/demo.downlist.js @@ -1,3 +1,144 @@ +BICst.CONF = {}; +BICst.CONF.GROUP = {}; +BICst.CONF.GROUP.NUMBER = {}; +BICst.CONF.GROUP.NUMBER = {}; +BICst.CONF.GROUP.NUMBER.GROUP_BY_VALUE = 1; +BICst.CONF.GROUP.NUMBER.CUSTOM_NUMBER_GROUP = 2; +BICst.CONF.GROUP.NUMBER.SUM = 3; +BICst.CONF.GROUP.NUMBER.AVG = 4; +BICst.CONF.GROUP.NUMBER.MEDIAN = 5; +BICst.CONF.GROUP.NUMBER.MAX = 6; +BICst.CONF.GROUP.NUMBER.MIN = 7; +BICst.CONF.GROUP.NUMBER.STANDARD_DEVIATION = 8; +BICst.CONF.GROUP.NUMBER.VARIANCE = 9; +BICst.CONF.GROUP.NUMBER.COUNT = 10; +BICst.CONF.GROUP.NUMBER.RECORD_COUNT = 11; +BICst.CONF.GROUP.NUMBER.NONE = 12; +BICst.CONF.GROUP.NUMBER.PERIOD = 13; +BICst.CONF.GROUP.NUMBER.RING = 14; +BICst.CONF.GROUP.NUMBER.PERIOD_RATE = 15; +BICst.CONF.GROUP.NUMBER.RING_RATE = 16; +BICst.CONF.GROUP.NUMBER.YEAR = 17; +BICst.CONF.GROUP.NUMBER.QUARTER = 18; +BICst.CONF.GROUP.NUMBER.MONTH = 19; +BICst.CONF.GROUP.NUMBER.WEEK = 20; +BICst.CONF.GROUP.NUMBER.WEEKDAY = 21; +BICst.CONF.GROUP.NUMBER.RENAME = 22; +BICst.CONF.GROUP.NUMBER.DELETE = 23; + +// 数值字段汇总设置 +var items = [[{ + text: BI.i18nText("BI-Basic_Qiu_Sum"), + value: BICst.CONF.GROUP.NUMBER.SUM, + cls: "dot-ha-font" +}, { + text: BI.i18nText("BI-Basic_Qiu_Avg"), + value: BICst.CONF.GROUP.NUMBER.AVG, + cls: "dot-ha-font" +}, { + text: BI.i18nText("BI-Basic_Qiu_Median"), + value: BICst.CONF.GROUP.NUMBER.MEDIAN, + cls: "dot-ha-font" +}, { + text: BI.i18nText("BI-Basic_Qiu_Max"), + value: BICst.CONF.GROUP.NUMBER.MAX, + cls: "dot-ha-font" +}, { + text: BI.i18nText("BI-Basic_Qiu_Min"), + value: BICst.CONF.GROUP.NUMBER.MIN, + cls: "dot-ha-font" +}, { + text: BI.i18nText("BI-Basic_Qiu_Standard_Deviation"), + value: BICst.CONF.GROUP.NUMBER.STANDARD_DEVIATION, + cls: "dot-ha-font" +}, { + text: BI.i18nText("BI-Basic_Qiu_Variance"), + value: BICst.CONF.GROUP.NUMBER.VARIANCE, + cls: "dot-ha-font" +}, { + text: BI.i18nText("BI-Basic_No_Repeat_Count"), + value: BICst.CONF.GROUP.NUMBER.COUNT, + cls: "dot-ha-font" +}, { + text: BI.i18nText("BI-Basic_Record_Count"), + value: BICst.CONF.GROUP.NUMBER.RECORD_COUNT, + cls: "dot-ha-font" +}], [{ + text: BI.i18nText("BI-Basic_None"), + value: BICst.CONF.GROUP.NUMBER.NONE, + cls: "dot-ha-font" +}, { + el: { + text: BI.i18nText("BI-Basic_Qiu_Same_Period"), + value: BICst.CONF.GROUP.NUMBER.PERIOD, + cls: "dot-ha-font" + }, + children: [{ + text: BI.i18nText("BI-Basic_Multi_Date_Year"), + value: BICst.CONF.GROUP.NUMBER.YEAR, + cls: "dot-ha-font" + }, { + text: BI.i18nText("BI-Basic_Quarter"), + value: BICst.CONF.GROUP.NUMBER.QUARTER, + cls: "dot-ha-font" + }, { + text: BI.i18nText("BI-Basic_Multi_Date_Month"), + value: BICst.CONF.GROUP.NUMBER.MONTH, + cls: "dot-ha-font" + }, { + text: BI.i18nText("BI-Basic_Multi_Date_Week"), + value: BICst.CONF.GROUP.NUMBER.WEEK, + cls: "dot-ha-font" + }, { + text: BI.i18nText("BI-Basic_Week_XingQi"), + value: BICst.CONF.GROUP.NUMBER.WEEKDAY, + cls: "dot-ha-font" + }] +}, { + text: BI.i18nText("BI-Basic_Qiu_Same_Ring"), + value: BICst.CONF.GROUP.NUMBER.RING, + cls: "dot-ha-font" +}, { + el: { + text: BI.i18nText("BI-Basic_Qiu_Same_Period_Rate"), + value: BICst.CONF.GROUP.NUMBER.PERIOD_RATE, + cls: "dot-ha-font" + }, + children: [{ + text: BI.i18nText("BI-Basic_Multi_Date_Year"), + value: BICst.CONF.GROUP.NUMBER.YEAR, + cls: "dot-ha-font" + }, { + text: BI.i18nText("BI-Basic_Quarter"), + value: BICst.CONF.GROUP.NUMBER.QUARTER, + cls: "dot-ha-font" + }, { + text: BI.i18nText("BI-Basic_Multi_Date_Month"), + value: BICst.CONF.GROUP.NUMBER.MONTH, + cls: "dot-ha-font" + }, { + text: BI.i18nText("BI-Basic_Multi_Date_Week"), + value: BICst.CONF.GROUP.NUMBER.WEEK, + cls: "dot-ha-font" + }, { + text: BI.i18nText("BI-Basic_Week_XingQi"), + value: BICst.CONF.GROUP.NUMBER.WEEKDAY, + cls: "dot-ha-font" + }] +}, { + text: BI.i18nText("BI-Basic_Qiu_Same_Ring_Rate"), + value: BICst.CONF.GROUP.NUMBER.RING_RATE, + cls: "dot-ha-font" +}], [{ + text: BI.i18nText("BI-Basic_Rename"), + value: BICst.CONF.GROUP.NUMBER.RENAME, + cls: "widget-combo-rename-edit-font" +}], [{ + text: BI.i18nText("BI-Basic_Remove"), + value: BICst.CONF.GROUP.NUMBER.DELETE, + cls: "delete-h-font" +}]]; + Demo.Downlist = BI.inherit(BI.Widget, { props: { baseCls: "demo-downlist" @@ -26,97 +167,98 @@ Demo.Downlist = BI.inherit(BI.Widget, { self.downlist = _ref; }, cls: "layout-bg3", - value: [{"childValue":22,"value":11},{"value":18},{"value":20}], + //value: [{"childValue":22,"value":11},{"value":18},{"value":20}], height: 30, width: 100, - items: [ - [{ - el: { - text: "column 1111", - iconCls1: "check-mark-e-font", - value: 11 - }, - children: [{ - text: "column 1.1", - value: 21, - cls: "dot-e-font" - }, { - text: "column 1.222222222222222222222222222222222222", - cls: "dot-e-font", - value: 22 - }] - }], - [{ - el: { - type: "bi.icon_text_icon_item", - text: "column 2", - iconCls1: "chart-type-e-font", - cls: "dot-e-font", - value: 12 - }, - disabled: true, - children: [{ - type: "bi.icon_text_item", - cls: "dot-e-font", - height: 25, - text: "column 2.1", - value: 11 - }, { - text: "column 2.2", - value: 12, - cls: "dot-e-font" - }] - }], - [{ - text: "column 8", - value: 18, - cls: "dot-e-font" - }, - { - - text: "column 9", - cls: "dot-e-font", - value: 19 - } - ], - [{ - text: "column 10", - value: 20, - cls: "dot-e-font" - }, - { - - text: "column 11", - cls: "dot-e-font", - value: 21 - }, - { - - text: "column 12", - cls: "dot-e-font", - value: 22 - }, - { - - text: "column 13", - cls: "dot-e-font", - value: 23 - }, - { - - text: "column 14", - cls: "dot-e-font", - value: 24 - }, - { - - text: "column 15", - cls: "dot-e-font", - value: 23 - } - ] - - ] + items: items + // items: [ + // [{ + // el: { + // text: "column 1111", + // iconCls1: "check-mark-e-font", + // value: 11 + // }, + // children: [{ + // text: "column 1.1", + // value: 21, + // cls: "dot-e-font" + // }, { + // text: "column 1.222222222222222222222222222222222222", + // cls: "dot-e-font", + // value: 22 + // }] + // }], + // [{ + // el: { + // type: "bi.icon_text_icon_item", + // text: "column 2", + // iconCls1: "chart-type-e-font", + // cls: "dot-e-font", + // value: 12 + // }, + // disabled: true, + // children: [{ + // type: "bi.icon_text_item", + // cls: "dot-e-font", + // height: 25, + // text: "column 2.1", + // value: 11 + // }, { + // text: "column 2.2", + // value: 12, + // cls: "dot-e-font" + // }] + // }], + // [{ + // text: "column 8", + // value: 18, + // cls: "dot-e-font" + // }, + // { + // + // text: "column 9", + // cls: "dot-e-font", + // value: 19 + // } + // ], + // [{ + // text: "column 10", + // value: 20, + // cls: "dot-e-font" + // }, + // { + // + // text: "column 11", + // cls: "dot-e-font", + // value: 21 + // }, + // { + // + // text: "column 12", + // cls: "dot-e-font", + // value: 22 + // }, + // { + // + // text: "column 13", + // cls: "dot-e-font", + // value: 23 + // }, + // { + // + // text: "column 14", + // cls: "dot-e-font", + // value: 24 + // }, + // { + // + // text: "column 15", + // cls: "dot-e-font", + // value: 23 + // } + // ] + // + // ] }, { type: "bi.label", text: "显示选择值", diff --git a/dist/bundle.js b/dist/bundle.js index ec4d03c2d..58041d7f5 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -80390,6 +80390,26 @@ BI.DownListPopup = BI.inherit(BI.Pane, { return valueArray; }, + _checkValues: function (values) { + var self = this; + var value = []; + BI.each(this.options.items, function (idx, itemGroup) { + BI.each(itemGroup, function (id, item) { + if(BI.isNotNull(item.children)){ + var childValues = BI.pluck(item.children, "value"); + if(BI.contains(childValues, values[idx])){ + value.push(values[idx]); + } + }else{ + if(item.value === values[idx]){ + value.push(values[idx]); + } + } + }) + }); + return value; + }, + populate: function (items) { BI.DownListPopup.superclass.populate.apply(this, arguments); var self = this; @@ -80411,7 +80431,7 @@ BI.DownListPopup = BI.inherit(BI.Pane, { getValue: function () { var self = this, result = []; - var values = this.popup.getValue(); + var values = this._checkValues(this.popup.getValue()); BI.each(values, function (i, value) { var valueItem = {}; if (BI.isNotNull(self.childValueMap[value])) { diff --git a/dist/demo.js b/dist/demo.js index cd7bbe6f6..5c75e6a27 100644 --- a/dist/demo.js +++ b/dist/demo.js @@ -12326,7 +12326,148 @@ Demo.CustomDateTime = BI.inherit(BI.Widget, { }; } }); -BI.shortcut("demo.date_time", Demo.CustomDateTime);Demo.Downlist = BI.inherit(BI.Widget, { +BI.shortcut("demo.date_time", Demo.CustomDateTime);BICst.CONF = {}; +BICst.CONF.GROUP = {}; +BICst.CONF.GROUP.NUMBER = {}; +BICst.CONF.GROUP.NUMBER = {}; +BICst.CONF.GROUP.NUMBER.GROUP_BY_VALUE = 1; +BICst.CONF.GROUP.NUMBER.CUSTOM_NUMBER_GROUP = 2; +BICst.CONF.GROUP.NUMBER.SUM = 3; +BICst.CONF.GROUP.NUMBER.AVG = 4; +BICst.CONF.GROUP.NUMBER.MEDIAN = 5; +BICst.CONF.GROUP.NUMBER.MAX = 6; +BICst.CONF.GROUP.NUMBER.MIN = 7; +BICst.CONF.GROUP.NUMBER.STANDARD_DEVIATION = 8; +BICst.CONF.GROUP.NUMBER.VARIANCE = 9; +BICst.CONF.GROUP.NUMBER.COUNT = 10; +BICst.CONF.GROUP.NUMBER.RECORD_COUNT = 11; +BICst.CONF.GROUP.NUMBER.NONE = 12; +BICst.CONF.GROUP.NUMBER.PERIOD = 13; +BICst.CONF.GROUP.NUMBER.RING = 14; +BICst.CONF.GROUP.NUMBER.PERIOD_RATE = 15; +BICst.CONF.GROUP.NUMBER.RING_RATE = 16; +BICst.CONF.GROUP.NUMBER.YEAR = 17; +BICst.CONF.GROUP.NUMBER.QUARTER = 18; +BICst.CONF.GROUP.NUMBER.MONTH = 19; +BICst.CONF.GROUP.NUMBER.WEEK = 20; +BICst.CONF.GROUP.NUMBER.WEEKDAY = 21; +BICst.CONF.GROUP.NUMBER.RENAME = 22; +BICst.CONF.GROUP.NUMBER.DELETE = 23; + +// 数值字段汇总设置 +var items = [[{ + text: BI.i18nText("BI-Basic_Qiu_Sum"), + value: BICst.CONF.GROUP.NUMBER.SUM, + cls: "dot-ha-font" +}, { + text: BI.i18nText("BI-Basic_Qiu_Avg"), + value: BICst.CONF.GROUP.NUMBER.AVG, + cls: "dot-ha-font" +}, { + text: BI.i18nText("BI-Basic_Qiu_Median"), + value: BICst.CONF.GROUP.NUMBER.MEDIAN, + cls: "dot-ha-font" +}, { + text: BI.i18nText("BI-Basic_Qiu_Max"), + value: BICst.CONF.GROUP.NUMBER.MAX, + cls: "dot-ha-font" +}, { + text: BI.i18nText("BI-Basic_Qiu_Min"), + value: BICst.CONF.GROUP.NUMBER.MIN, + cls: "dot-ha-font" +}, { + text: BI.i18nText("BI-Basic_Qiu_Standard_Deviation"), + value: BICst.CONF.GROUP.NUMBER.STANDARD_DEVIATION, + cls: "dot-ha-font" +}, { + text: BI.i18nText("BI-Basic_Qiu_Variance"), + value: BICst.CONF.GROUP.NUMBER.VARIANCE, + cls: "dot-ha-font" +}, { + text: BI.i18nText("BI-Basic_No_Repeat_Count"), + value: BICst.CONF.GROUP.NUMBER.COUNT, + cls: "dot-ha-font" +}, { + text: BI.i18nText("BI-Basic_Record_Count"), + value: BICst.CONF.GROUP.NUMBER.RECORD_COUNT, + cls: "dot-ha-font" +}], [{ + text: BI.i18nText("BI-Basic_None"), + value: BICst.CONF.GROUP.NUMBER.NONE, + cls: "dot-ha-font" +}, { + el: { + text: BI.i18nText("BI-Basic_Qiu_Same_Period"), + value: BICst.CONF.GROUP.NUMBER.PERIOD, + cls: "dot-ha-font" + }, + children: [{ + text: BI.i18nText("BI-Basic_Multi_Date_Year"), + value: BICst.CONF.GROUP.NUMBER.YEAR, + cls: "dot-ha-font" + }, { + text: BI.i18nText("BI-Basic_Quarter"), + value: BICst.CONF.GROUP.NUMBER.QUARTER, + cls: "dot-ha-font" + }, { + text: BI.i18nText("BI-Basic_Multi_Date_Month"), + value: BICst.CONF.GROUP.NUMBER.MONTH, + cls: "dot-ha-font" + }, { + text: BI.i18nText("BI-Basic_Multi_Date_Week"), + value: BICst.CONF.GROUP.NUMBER.WEEK, + cls: "dot-ha-font" + }, { + text: BI.i18nText("BI-Basic_Week_XingQi"), + value: BICst.CONF.GROUP.NUMBER.WEEKDAY, + cls: "dot-ha-font" + }] +}, { + text: BI.i18nText("BI-Basic_Qiu_Same_Ring"), + value: BICst.CONF.GROUP.NUMBER.RING, + cls: "dot-ha-font" +}, { + el: { + text: BI.i18nText("BI-Basic_Qiu_Same_Period_Rate"), + value: BICst.CONF.GROUP.NUMBER.PERIOD_RATE, + cls: "dot-ha-font" + }, + children: [{ + text: BI.i18nText("BI-Basic_Multi_Date_Year"), + value: BICst.CONF.GROUP.NUMBER.YEAR, + cls: "dot-ha-font" + }, { + text: BI.i18nText("BI-Basic_Quarter"), + value: BICst.CONF.GROUP.NUMBER.QUARTER, + cls: "dot-ha-font" + }, { + text: BI.i18nText("BI-Basic_Multi_Date_Month"), + value: BICst.CONF.GROUP.NUMBER.MONTH, + cls: "dot-ha-font" + }, { + text: BI.i18nText("BI-Basic_Multi_Date_Week"), + value: BICst.CONF.GROUP.NUMBER.WEEK, + cls: "dot-ha-font" + }, { + text: BI.i18nText("BI-Basic_Week_XingQi"), + value: BICst.CONF.GROUP.NUMBER.WEEKDAY, + cls: "dot-ha-font" + }] +}, { + text: BI.i18nText("BI-Basic_Qiu_Same_Ring_Rate"), + value: BICst.CONF.GROUP.NUMBER.RING_RATE, + cls: "dot-ha-font" +}], [{ + text: BI.i18nText("BI-Basic_Rename"), + value: BICst.CONF.GROUP.NUMBER.RENAME, + cls: "widget-combo-rename-edit-font" +}], [{ + text: BI.i18nText("BI-Basic_Remove"), + value: BICst.CONF.GROUP.NUMBER.DELETE, + cls: "delete-h-font" +}]]; + +Demo.Downlist = BI.inherit(BI.Widget, { props: { baseCls: "demo-downlist" }, @@ -12354,97 +12495,98 @@ BI.shortcut("demo.date_time", Demo.CustomDateTime);Demo.Downlist = BI.inherit(BI self.downlist = _ref; }, cls: "layout-bg3", - value: [{"childValue":22,"value":11},{"value":18},{"value":20}], + //value: [{"childValue":22,"value":11},{"value":18},{"value":20}], height: 30, width: 100, - items: [ - [{ - el: { - text: "column 1111", - iconCls1: "check-mark-e-font", - value: 11 - }, - children: [{ - text: "column 1.1", - value: 21, - cls: "dot-e-font" - }, { - text: "column 1.222222222222222222222222222222222222", - cls: "dot-e-font", - value: 22 - }] - }], - [{ - el: { - type: "bi.icon_text_icon_item", - text: "column 2", - iconCls1: "chart-type-e-font", - cls: "dot-e-font", - value: 12 - }, - disabled: true, - children: [{ - type: "bi.icon_text_item", - cls: "dot-e-font", - height: 25, - text: "column 2.1", - value: 11 - }, { - text: "column 2.2", - value: 12, - cls: "dot-e-font" - }] - }], - [{ - text: "column 8", - value: 18, - cls: "dot-e-font" - }, - { - - text: "column 9", - cls: "dot-e-font", - value: 19 - } - ], - [{ - text: "column 10", - value: 20, - cls: "dot-e-font" - }, - { - - text: "column 11", - cls: "dot-e-font", - value: 21 - }, - { - - text: "column 12", - cls: "dot-e-font", - value: 22 - }, - { - - text: "column 13", - cls: "dot-e-font", - value: 23 - }, - { - - text: "column 14", - cls: "dot-e-font", - value: 24 - }, - { - - text: "column 15", - cls: "dot-e-font", - value: 23 - } - ] - - ] + items: items + // items: [ + // [{ + // el: { + // text: "column 1111", + // iconCls1: "check-mark-e-font", + // value: 11 + // }, + // children: [{ + // text: "column 1.1", + // value: 21, + // cls: "dot-e-font" + // }, { + // text: "column 1.222222222222222222222222222222222222", + // cls: "dot-e-font", + // value: 22 + // }] + // }], + // [{ + // el: { + // type: "bi.icon_text_icon_item", + // text: "column 2", + // iconCls1: "chart-type-e-font", + // cls: "dot-e-font", + // value: 12 + // }, + // disabled: true, + // children: [{ + // type: "bi.icon_text_item", + // cls: "dot-e-font", + // height: 25, + // text: "column 2.1", + // value: 11 + // }, { + // text: "column 2.2", + // value: 12, + // cls: "dot-e-font" + // }] + // }], + // [{ + // text: "column 8", + // value: 18, + // cls: "dot-e-font" + // }, + // { + // + // text: "column 9", + // cls: "dot-e-font", + // value: 19 + // } + // ], + // [{ + // text: "column 10", + // value: 20, + // cls: "dot-e-font" + // }, + // { + // + // text: "column 11", + // cls: "dot-e-font", + // value: 21 + // }, + // { + // + // text: "column 12", + // cls: "dot-e-font", + // value: 22 + // }, + // { + // + // text: "column 13", + // cls: "dot-e-font", + // value: 23 + // }, + // { + // + // text: "column 14", + // cls: "dot-e-font", + // value: 24 + // }, + // { + // + // text: "column 15", + // cls: "dot-e-font", + // value: 23 + // } + // ] + // + // ] }, { type: "bi.label", text: "显示选择值", diff --git a/dist/fineui.js b/dist/fineui.js index 5610722eb..84fc13e89 100644 --- a/dist/fineui.js +++ b/dist/fineui.js @@ -82084,6 +82084,26 @@ BI.DownListPopup = BI.inherit(BI.Pane, { return valueArray; }, + _checkValues: function (values) { + var self = this; + var value = []; + BI.each(this.options.items, function (idx, itemGroup) { + BI.each(itemGroup, function (id, item) { + if(BI.isNotNull(item.children)){ + var childValues = BI.pluck(item.children, "value"); + if(BI.contains(childValues, values[idx])){ + value.push(values[idx]); + } + }else{ + if(item.value === values[idx]){ + value.push(values[idx]); + } + } + }) + }); + return value; + }, + populate: function (items) { BI.DownListPopup.superclass.populate.apply(this, arguments); var self = this; @@ -82105,7 +82125,7 @@ BI.DownListPopup = BI.inherit(BI.Pane, { getValue: function () { var self = this, result = []; - var values = this.popup.getValue(); + var values = this._checkValues(this.popup.getValue()); BI.each(values, function (i, value) { var valueItem = {}; if (BI.isNotNull(self.childValueMap[value])) { diff --git a/dist/widget.js b/dist/widget.js index 5af512637..34b5989da 100644 --- a/dist/widget.js +++ b/dist/widget.js @@ -3976,6 +3976,26 @@ BI.DownListPopup = BI.inherit(BI.Pane, { return valueArray; }, + _checkValues: function (values) { + var self = this; + var value = []; + BI.each(this.options.items, function (idx, itemGroup) { + BI.each(itemGroup, function (id, item) { + if(BI.isNotNull(item.children)){ + var childValues = BI.pluck(item.children, "value"); + if(BI.contains(childValues, values[idx])){ + value.push(values[idx]); + } + }else{ + if(item.value === values[idx]){ + value.push(values[idx]); + } + } + }) + }); + return value; + }, + populate: function (items) { BI.DownListPopup.superclass.populate.apply(this, arguments); var self = this; @@ -3997,7 +4017,7 @@ BI.DownListPopup = BI.inherit(BI.Pane, { getValue: function () { var self = this, result = []; - var values = this.popup.getValue(); + var values = this._checkValues(this.popup.getValue()); BI.each(values, function (i, value) { var valueItem = {}; if (BI.isNotNull(self.childValueMap[value])) { diff --git a/src/widget/downlist/popup.downlist.js b/src/widget/downlist/popup.downlist.js index 458d8d857..e0d984e57 100644 --- a/src/widget/downlist/popup.downlist.js +++ b/src/widget/downlist/popup.downlist.js @@ -193,6 +193,26 @@ BI.DownListPopup = BI.inherit(BI.Pane, { return valueArray; }, + _checkValues: function (values) { + var self = this; + var value = []; + BI.each(this.options.items, function (idx, itemGroup) { + BI.each(itemGroup, function (id, item) { + if(BI.isNotNull(item.children)){ + var childValues = BI.pluck(item.children, "value"); + if(BI.contains(childValues, values[idx])){ + value.push(values[idx]); + } + }else{ + if(item.value === values[idx]){ + value.push(values[idx]); + } + } + }) + }); + return value; + }, + populate: function (items) { BI.DownListPopup.superclass.populate.apply(this, arguments); var self = this; @@ -214,7 +234,7 @@ BI.DownListPopup = BI.inherit(BI.Pane, { getValue: function () { var self = this, result = []; - var values = this.popup.getValue(); + var values = this._checkValues(this.popup.getValue()); BI.each(values, function (i, value) { var valueItem = {}; if (BI.isNotNull(self.childValueMap[value])) {