@@ -36,12 +36,12 @@ const changePaging = function (that, optionName, value) {
3636 if ( value !== undefined ) {
3737 const oldValue = that . _getPagingOptionValue ( optionName ) ;
3838 if ( oldValue !== value ) {
39- if ( optionName === 'pageSize' ) {
39+ that . _skipProcessingPagingChange = true ;
40+ if ( optionName === 'pageSize' && value === 0 ) {
4041 dataSource . pageIndex ( 0 ) ;
42+ that . option ( 'paging.pageIndex' , 0 ) ;
4143 }
4244 dataSource [ optionName ] ( value ) ;
43-
44- that . _skipProcessingPagingChange = true ;
4545 that . option ( `paging.${ optionName } ` , value ) ;
4646 that . _skipProcessingPagingChange = false ;
4747 const pageIndex = dataSource . pageIndex ( ) ;
@@ -213,11 +213,7 @@ export class DataController extends DataHelperMixin(modules.Controller) {
213213
214214 this . _isPaging = false ;
215215 this . _currentOperationTypes = null ;
216- this . _dataChangedHandler = ( e ) => {
217- this . _currentOperationTypes = this . _dataSource . operationTypes ( ) ;
218- this . _handleDataChanged ( e ) ;
219- this . _currentOperationTypes = null ;
220- } ;
216+ this . _dataChangedHandler = this . _handleDataChanged . bind ( this ) ;
221217 this . _columnsChangedHandler = this . _handleColumnsChanged . bind ( this ) ;
222218 this . _loadingChangedHandler = this . _handleLoadingChanged . bind ( this ) ;
223219 this . _loadErrorHandler = this . _handleLoadError . bind ( this ) ;
@@ -588,6 +584,7 @@ export class DataController extends DataHelperMixin(modules.Controller) {
588584 errors . log ( 'W1005' , that . component . NAME ) ;
589585 that . _applyFilter ( ) ;
590586 } else {
587+ this . _currentOperationTypes = dataSource . operationTypes ( ) ;
591588 that . updateItems ( e , true ) ;
592589 }
593590 } ) . fail ( ( ) => {
@@ -1170,6 +1167,8 @@ export class DataController extends DataHelperMixin(modules.Controller) {
11701167 const changeType = change . changeType || 'refresh' ;
11711168
11721169 change . changeType = changeType ;
1170+ change . operationTypes ??= this . _currentOperationTypes ;
1171+ this . _currentOperationTypes = null ;
11731172
11741173 if ( dataSource ) {
11751174 const cachedProcessedItems = this . _cachedProcessedItems ;
@@ -1231,36 +1230,35 @@ export class DataController extends DataHelperMixin(modules.Controller) {
12311230 }
12321231 }
12331232
1234- public updateItems ( change ?, isDataChanged ?) {
1235- change = change || { } ;
1236- const that = this ;
1237- change . isFirstRender = ! that . changed . fired ( ) ;
1233+ public updateItems ( change : any = { } , isDataChanged ?: boolean ) {
1234+ change . isFirstRender = ! this . changed . fired ( ) ;
12381235
1239- if ( that . _repaintChangesOnly !== undefined ) {
1240- change . repaintChangesOnly = change . repaintChangesOnly ?? that . _repaintChangesOnly ;
1241- change . needUpdateDimensions = change . needUpdateDimensions || that . _needUpdateDimensions ;
1236+ if ( this . _repaintChangesOnly !== undefined ) {
1237+ change . repaintChangesOnly ??= this . _repaintChangesOnly ;
1238+ change . needUpdateDimensions = change . needUpdateDimensions || this . _needUpdateDimensions ;
12421239 } else if ( change . changes ) {
1243- change . repaintChangesOnly = that . option ( 'repaintChangesOnly' ) ;
1240+ change . repaintChangesOnly = this . option ( 'repaintChangesOnly' ) ;
12441241 } else if ( isDataChanged ) {
1245- const operationTypes = that . dataSource ( ) . operationTypes ( ) ;
1242+ const operationTypes = this . dataSource ( ) . operationTypes ( ) ;
12461243
1247- change . repaintChangesOnly = operationTypes && ! operationTypes . grouping && ! operationTypes . filtering && that . option ( 'repaintChangesOnly' ) ;
12481244 change . isDataChanged = true ;
1245+ change . repaintChangesOnly = operationTypes && ! operationTypes . grouping && ! operationTypes . filtering && this . option ( 'repaintChangesOnly' ) ;
1246+
12491247 if ( operationTypes && ( operationTypes . reload || operationTypes . paging || operationTypes . groupExpanding ) ) {
12501248 change . needUpdateDimensions = true ;
12511249 }
12521250 }
12531251
1254- if ( that . _updateLockCount && ! change . cancel ) {
1255- that . _changes . push ( change ) ;
1252+ if ( this . _updateLockCount && ! change . cancel ) {
1253+ this . _changes . push ( change ) ;
12561254 return ;
12571255 }
12581256
1259- that . _updateItemsCore ( change ) ;
1257+ this . _updateItemsCore ( change ) ;
12601258
12611259 if ( change . cancel ) return ;
12621260
1263- that . _fireChanged ( change ) ;
1261+ this . _fireChanged ( change ) ;
12641262 }
12651263
12661264 public loadingOperationTypes ( ) {
@@ -1273,10 +1271,6 @@ export class DataController extends DataHelperMixin(modules.Controller) {
12731271 * @extended : virtual_scrolling, focus
12741272 */
12751273 protected _fireChanged ( change ) {
1276- if ( this . _currentOperationTypes ) {
1277- change . operationTypes = this . _currentOperationTypes ;
1278- this . _currentOperationTypes = null ;
1279- }
12801274 deferRender ( ( ) => {
12811275 this . changed . fire ( change ) ;
12821276 } ) ;
0 commit comments