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