@@ -119,7 +119,8 @@ var __meta__ = { // jshint ignore:line
119119 direction : "row" ,
120120 wrap : "nowrap"
121121 } ,
122- grid : { }
122+ grid : { } ,
123+ scrollable : false
123124 } ,
124125
125126 setOptions : function ( options ) {
@@ -167,6 +168,10 @@ var __meta__ = { // jshint ignore:line
167168 if ( this . options . autoBind ) {
168169 dataSource . fetch ( ) ;
169170 }
171+
172+ if ( this . options . scrollable === "endless" ) {
173+ this . _bindScrollable ( ) ;
174+ }
170175 } ,
171176
172177 _unbindDataSource : function ( ) {
@@ -478,25 +483,30 @@ var __meta__ = { // jshint ignore:line
478483 } ) ;
479484
480485 if ( scrollable === "endless" ) {
481- var originalPageSize = that . _endlessPageSize = that . dataSource . options . pageSize ;
482-
483- that . content
484- . off ( "scroll" + NS )
485- . on ( "scroll" + NS , function ( ) {
486- if ( this . scrollTop + this . clientHeight - this . scrollHeight >= - 15 &&
487- ! that . _endlessFetchInProgress &&
488- that . _endlessPageSize < that . dataSource . total ( ) ) {
489- that . _skipRerenderItemsCount = that . _endlessPageSize ;
490- that . _endlessPageSize = that . _skipRerenderItemsCount + originalPageSize ;
491- that . dataSource . options . endless = true ;
492- that . _endlessFetchInProgress = true ;
493- that . dataSource . pageSize ( that . _endlessPageSize ) ;
494- }
495- } ) ;
486+ that . _bindScrollable ( ) ;
496487 }
497488 }
498489 } ,
499490
491+ _bindScrollable : function ( ) {
492+ var that = this ;
493+ var originalPageSize = that . _endlessPageSize = that . dataSource . options . pageSize ;
494+
495+ that . content
496+ . off ( "scroll" + NS )
497+ . on ( "scroll" + NS , function ( ) {
498+ if ( this . scrollTop + this . clientHeight - this . scrollHeight >= - 15 &&
499+ ! that . _endlessFetchInProgress &&
500+ that . _endlessPageSize < that . dataSource . total ( ) ) {
501+ that . _skipRerenderItemsCount = that . _endlessPageSize ;
502+ that . _endlessPageSize = that . _skipRerenderItemsCount + originalPageSize ;
503+ that . dataSource . options . endless = true ;
504+ that . _endlessFetchInProgress = true ;
505+ that . dataSource . pageSize ( that . _endlessPageSize ) ;
506+ }
507+ } ) ;
508+ } ,
509+
500510 current : function ( candidate ) {
501511 var that = this ,
502512 element = that . element ,
0 commit comments