|
|
|
@ -26,6 +26,7 @@ BI.MultiLayerDownListPopup = BI.inherit(BI.Pane, {
|
|
|
|
|
this.singleValues = []; |
|
|
|
|
this.childValueMap = {}; |
|
|
|
|
this.fatherValueMap = {}; |
|
|
|
|
this.items = []; |
|
|
|
|
var self = this, o = this.options, children = this._createPopupItems(o.items); |
|
|
|
|
this.popup = BI.createWidget({ |
|
|
|
|
type: "bi.button_tree", |
|
|
|
@ -83,19 +84,22 @@ BI.MultiLayerDownListPopup = BI.inherit(BI.Pane, {
|
|
|
|
|
type: "bi.down_list_group", |
|
|
|
|
items: [] |
|
|
|
|
}; |
|
|
|
|
var storeItem = []; |
|
|
|
|
|
|
|
|
|
BI.each(it, function (i, item) { |
|
|
|
|
if (BI.isNotEmptyArray(item.children) && !BI.isEmpty(item.el)) { |
|
|
|
|
BI.each(it, function (i, sourceItem) { |
|
|
|
|
var item = BI.extend({}, sourceItem); |
|
|
|
|
if (BI.isNotEmptyArray(sourceItem.children) && !BI.isEmpty(sourceItem.el)) { |
|
|
|
|
item.type = "bi.combo_group"; |
|
|
|
|
item.cls = "down-list-group"; |
|
|
|
|
item.trigger = "hover"; |
|
|
|
|
item.isNeedAdjustWidth = false; |
|
|
|
|
item.el.title = item.el.title || item.el.text; |
|
|
|
|
item.el = sourceItem.el; |
|
|
|
|
item.el.title = sourceItem.el.title || sourceItem.el.text; |
|
|
|
|
item.el.type = "bi.down_list_group_item"; |
|
|
|
|
item.el.logic = { |
|
|
|
|
dynamic: true |
|
|
|
|
}; |
|
|
|
|
item.el.height = item.el.height || self.constants.height; |
|
|
|
|
item.el.height = sourceItem.el.height || self.constants.height; |
|
|
|
|
item.el.iconCls2 = self.constants.nextIcon; |
|
|
|
|
item.popup = { |
|
|
|
|
lgap: 1, |
|
|
|
@ -110,10 +114,10 @@ BI.MultiLayerDownListPopup = BI.inherit(BI.Pane, {
|
|
|
|
|
innerVgap: 5, |
|
|
|
|
maxHeight: 378, |
|
|
|
|
}; |
|
|
|
|
self._createChildren(item); |
|
|
|
|
self._createChildren(item, sourceItem); |
|
|
|
|
} else { |
|
|
|
|
item.type = item.type || "bi.down_list_item"; |
|
|
|
|
item.title = item.title || item.text; |
|
|
|
|
item.type = sourceItem.type || "bi.down_list_item"; |
|
|
|
|
item.title = sourceItem.title || sourceItem.text; |
|
|
|
|
item.textRgap = 10; |
|
|
|
|
item.isNeedAdjustWidth = false; |
|
|
|
|
item.logic = { |
|
|
|
@ -123,6 +127,7 @@ BI.MultiLayerDownListPopup = BI.inherit(BI.Pane, {
|
|
|
|
|
var el_done = {}; |
|
|
|
|
el_done.el = item; |
|
|
|
|
item_done.items.push(el_done); |
|
|
|
|
storeItem.push(item); |
|
|
|
|
}); |
|
|
|
|
if (self._isGroup(item_done.items)) { |
|
|
|
|
BI.each(item_done.items, function (i, item) { |
|
|
|
@ -131,6 +136,7 @@ BI.MultiLayerDownListPopup = BI.inherit(BI.Pane, {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
result.push(item_done); |
|
|
|
|
self.items.push(storeItem); |
|
|
|
|
if (self._needSpliter(i, items.length)) { |
|
|
|
|
var spliter_container = BI.createWidget({ |
|
|
|
|
type: "bi.vertical", |
|
|
|
@ -152,34 +158,35 @@ BI.MultiLayerDownListPopup = BI.inherit(BI.Pane, {
|
|
|
|
|
return result; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
_createChildren: function (item) { |
|
|
|
|
_createChildren: function (targetItem, sourceItem) { |
|
|
|
|
var self = this; |
|
|
|
|
this._formatEL(item).el.childValues = []; |
|
|
|
|
item.items = item.children; |
|
|
|
|
BI.each(item.children, function (i, child) { |
|
|
|
|
child = child.el ? BI.extend(child.el, {children: child.children}) : child; |
|
|
|
|
var fatherValue = BI.deepClone(self._formatEL(item).el.value); |
|
|
|
|
var childValue = BI.deepClone(child.value); |
|
|
|
|
self.singleValues.push(child.value); |
|
|
|
|
child.type = child.type || "bi.down_list_item"; |
|
|
|
|
child.extraCls = " child-down-list-item"; |
|
|
|
|
child.title = child.title || child.text; |
|
|
|
|
child.textRgap = 10; |
|
|
|
|
child.isNeedAdjustWidth = false; |
|
|
|
|
child.logic = { |
|
|
|
|
this._formatEL(targetItem).el.childValues = []; |
|
|
|
|
targetItem.items = targetItem.children = []; |
|
|
|
|
BI.each(sourceItem.children, function (i, child) { |
|
|
|
|
var item = child.el ? BI.extend({}, child.el, {children: child.children}) : BI.extend({}, child); |
|
|
|
|
var fatherValue = BI.deepClone(self._formatEL(targetItem).el.value); |
|
|
|
|
var childValue = BI.deepClone(item.value); |
|
|
|
|
self.singleValues.push(item.value); |
|
|
|
|
item.type = item.type || "bi.down_list_item"; |
|
|
|
|
item.extraCls = " child-down-list-item"; |
|
|
|
|
item.title = item.title || item.text; |
|
|
|
|
item.textRgap = 10; |
|
|
|
|
item.isNeedAdjustWidth = false; |
|
|
|
|
item.logic = { |
|
|
|
|
dynamic: true |
|
|
|
|
}; |
|
|
|
|
child.father = fatherValue; |
|
|
|
|
item.father = fatherValue; |
|
|
|
|
self.fatherValueMap[self._createChildValue(fatherValue, childValue)] = fatherValue; |
|
|
|
|
self.childValueMap[self._createChildValue(fatherValue, childValue)] = childValue; |
|
|
|
|
child.value = self._createChildValue(fatherValue, childValue); |
|
|
|
|
self._formatEL(item).el.childValues.push(child.value); |
|
|
|
|
item.value = self._createChildValue(fatherValue, childValue); |
|
|
|
|
self._formatEL(targetItem).el.childValues.push(item.value); |
|
|
|
|
if (BI.isNotEmptyArray(child.children)) { |
|
|
|
|
child.type = "bi.down_list_group_item"; |
|
|
|
|
child.iconCls2 = self.constants.nextIcon; |
|
|
|
|
child.height = child.height || self.constants.height; |
|
|
|
|
self._createChildren(child); |
|
|
|
|
item.type = "bi.down_list_group_item"; |
|
|
|
|
item.iconCls2 = self.constants.nextIcon; |
|
|
|
|
item.height = child.height || self.constants.height; |
|
|
|
|
self._createChildren(item, child); |
|
|
|
|
} |
|
|
|
|
targetItem.items.push(item); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
@ -228,7 +235,7 @@ BI.MultiLayerDownListPopup = BI.inherit(BI.Pane, {
|
|
|
|
|
_checkValues: function (values) { |
|
|
|
|
var self = this, o = this.options; |
|
|
|
|
var value = []; |
|
|
|
|
BI.each(o.items, function (idx, itemGroup) { |
|
|
|
|
BI.each(this.items, function (idx, itemGroup) { |
|
|
|
|
BI.each(itemGroup, function (id, item) { |
|
|
|
|
if(BI.isNotNull(item.children)) { |
|
|
|
|
var childValues = getChildrenValue(item); |
|
|
|
@ -277,6 +284,7 @@ BI.MultiLayerDownListPopup = BI.inherit(BI.Pane, {
|
|
|
|
|
self.childValueMap = {}; |
|
|
|
|
self.fatherValueMap = {}; |
|
|
|
|
self.singleValues = []; |
|
|
|
|
this.items = []; |
|
|
|
|
var children = self._createPopupItems(items); |
|
|
|
|
var popupItem = BI.createItems(children, |
|
|
|
|
{}, { |
|
|
|
|