@ -51,7 +51,8 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, {
this . next . setLoading ( ) ;
this . next . setLoading ( ) ;
if ( this . cachItems && this . cachItems . length > 0 ) {
if ( this . cachItems && this . cachItems . length > 0 ) {
this . next . setLoaded ( ) ;
this . next . setLoaded ( ) ;
this . addItems ( this . cachItems . slice ( 0 , 100 ) ) ;
const items = this . _composeItems ( this . cachItems . slice ( 0 , 100 ) ) ;
this . addItems ( items ) ;
this . cachItems = this . cachItems . slice ( 100 ) ;
this . cachItems = this . cachItems . slice ( 100 ) ;
return ;
return ;
}
}
@ -170,6 +171,17 @@ BI.MultiSelectInnerLoader = BI.inherit(BI.Widget, {
this . button _group . addItems . apply ( this . button _group , arguments ) ;
this . button _group . addItems . apply ( this . button _group , arguments ) ;
} ,
} ,
_composeItems : function ( items ) {
const cacheValue = this . cachGroup . getValue ( ) ;
return items . map ( item => {
return {
... item ,
selected : cacheValue . includes ( item . value || item . id )
} ;
} ) ;
} ,
_populate : function ( items ) {
_populate : function ( items ) {
var self = this , o = this . options ;
var self = this , o = this . options ;
if ( arguments . length === 0 && ( BI . isFunction ( o . itemsCreator ) ) ) {
if ( arguments . length === 0 && ( BI . isFunction ( o . itemsCreator ) ) ) {