@ -40,10 +40,12 @@ BI.DisplaySelectedList = BI.inherit(BI.Pane, {
} ,
} ,
items : this . _createItems ( opts . items ) ,
items : this . _createItems ( opts . items ) ,
chooseType : BI . ButtonGroup . CHOOSE _TYPE _MULTI ,
chooseType : BI . ButtonGroup . CHOOSE _TYPE _MULTI ,
layouts : [ {
layouts : [
{
type : "bi.vertical" ,
type : "bi.vertical" ,
lgap : 10
lgap : 10
} ]
}
]
} ,
} ,
itemsCreator : function ( options , callback ) {
itemsCreator : function ( options , callback ) {
if ( options . times === 1 ) {
if ( options . times === 1 ) {
@ -53,10 +55,7 @@ BI.DisplaySelectedList = BI.inherit(BI.Pane, {
if ( cacheItems . length > 0 ) {
if ( cacheItems . length > 0 ) {
var renderedItems = cacheItems . slice ( 0 , 100 ) ;
var renderedItems = cacheItems . slice ( 0 , 100 ) ;
cacheItems = cacheItems . slice ( 100 ) ;
cacheItems = cacheItems . slice ( 100 ) ;
self . hasNext = true ;
self . hasNext = cacheItems . length > 0 ;
if ( cacheItems . length === 0 ) {
self . hasNext = false ;
}
callback ( self . _createItems ( renderedItems ) ) ;
callback ( self . _createItems ( renderedItems ) ) ;
return ;
return ;
}
}
@ -65,8 +64,8 @@ BI.DisplaySelectedList = BI.inherit(BI.Pane, {
self . hasNext = ! ! ob . hasNext ;
self . hasNext = ! ! ob . hasNext ;
var firstItemsCount = 100 + ob . items . length % 100 ;
var firstItemsCount = 100 + ob . items . length % 100 ;
if ( ob . items . length > 100 ) {
if ( ob . items . length > 100 ) {
cacheItems = ob . items . slice ( 100 + ob . items . length % 100 ) ;
cacheItems = ob . items . slice ( firstItemsCount ) ;
self . hasNext = true ;
self . hasNext = ( firstItemsCount === ob . items . length ) ? false : true ;
}
}
callback ( self . _createItems ( ob . items . slice ( 0 , firstItemsCount ) ) ) ;
callback ( self . _createItems ( ob . items . slice ( 0 , firstItemsCount ) ) ) ;
} ) ;
} ) ;