@ -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 = i tem. el . height || self . constants . height ;
item . el . height = sourceI tem. 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 = i tem. type || "bi.down_list_item" ;
item . title = i tem. title || i tem. text ;
item . type = sourceI tem. type || "bi.down_list_item" ;
item . title = sourceI tem. title || sourceI tem. 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 ( i tem) {
_createChildren : function ( targetItem , sourceI tem) {
var self = this ;
this . _formatEL ( i tem) . el . childValues = [ ] ;
i tem. items = i tem. children ;
BI . each ( i tem. children , function ( i , child ) {
child = child . el ? BI . extend ( child . el , { children : child . children } ) : child ;
var fatherValue = BI . deepClone ( self . _formatEL ( i tem) . 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 ( targetI tem) . el . childValues = [ ] ;
targetI tem. items = targetI tem. children = [ ] ;
BI . each ( sourceI tem. children , function ( i , child ) {
var item = child . el ? BI . extend ( { } , child . el , { children : child . children } ) : BI . extend ( { } , child ) ;
var fatherValue = BI . deepClone ( self . _formatEL ( targetI tem) . 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 ( i tem) . el . childValues . push ( child . value ) ;
item . value = self . _createChildValue ( fatherValue , childValue ) ;
self . _formatEL ( targetI tem) . 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 ,
{ } , {