@@ -271,6 +271,52 @@ test('Pager info should show page 1 of 1 after changing pageSize to \'all\' with
271271 height : 400 ,
272272} ) ) ;
273273
274+ test ( 'Pager info should show page 1 of 1 after changing pageSize to \'all\' and enabling virtual scrolling (T1327238)' , async ( t ) => {
275+ const dataGrid = new DataGrid ( '#container' ) ;
276+ const pager = dataGrid . getPager ( ) ;
277+
278+ await t
279+ . expect ( pager . getInfoText ( ) . textContent )
280+ . eql ( 'Page 5 of 10 (100 items)' ) ;
281+
282+ await t
283+ . click ( pager . getPageSize ( 1 ) . element )
284+ . expect ( pager . getInfoText ( ) . textContent )
285+ . eql ( 'Page 1 of 1 (100 items)' ) ;
286+ } ) . before ( async ( ) => createWidget ( 'dxDataGrid' , {
287+ dataSource : [ ...new Array ( 100 ) . keys ( ) ] . map ( ( i ) => ( { id : i } ) ) ,
288+ keyExpr : 'id' ,
289+ showBorders : true ,
290+ scrolling : {
291+ mode : 'standard' ,
292+ } ,
293+ paging : {
294+ pageSize : 10 ,
295+ pageIndex : 4 ,
296+ } ,
297+ pager : {
298+ visible : true ,
299+ allowedPageSizes : [ 10 , 'all' ] ,
300+ showPageSizeSelector : true ,
301+ showInfo : true ,
302+ showNavigationButtons : true ,
303+ } ,
304+ height : 400 ,
305+ onOptionChanged ( e ) {
306+ if ( e . fullName === "paging.pageSize" ) {
307+ const setVirtual = e . value === 0 ;
308+ const targetRenderingMode = setVirtual ? "virtual" : "standard" ;
309+ const currentRenderingMode = e . component . option ( "scrolling.mode" ) ;
310+ if ( currentRenderingMode !== targetRenderingMode ) {
311+ e . component . beginUpdate ( ) ;
312+ e . component . option ( "scrolling.mode" , targetRenderingMode ) ;
313+ e . component . repaint ( ) ;
314+ e . component . endUpdate ( ) ;
315+ }
316+ }
317+ } ,
318+ } ) ) ;
319+
274320test ( 'No error should occur if dataSource is not defined and pageIndex is promise chained (T1256070)' , async ( t ) => {
275321 const dataGrid = new DataGrid ( '#container' ) ;
276322
0 commit comments