import { IModelGenerator , IGrid , NotifyArgs } from '../base/interface' ; import { Column } from '../models/column' ; import { Row } from '../models/row' ; import { RowModelGenerator } from '../services/row-model-generator' ; hidden export class FreezeRowModelGenerator implements IModelGenerator < Column > { private rowModelGenerator : IModelGenerator < Column > ; private parent : IGrid ; private isFrzLoad : number = 1 ; constructor ( parent ) { this . parent = parent ; this . rowModelGenerator = new RowModelGenerator ( this . parent ) ; } public generateRows ( data , notifyArgs ? ) { let frzCols = this . parent . getFrozenColumns ( ) ; let row = this . rowModelGenerator . generateRows ( data , notifyArgs ) ; for ( let i = 0 , len = row . length ; i < len ; i ++ ) { if ( this . isFrzLoad % 2 === 0 ) { row [ i ] . cells = row [ i ] . cells . slice ( frzCols , row [ i ] . cells . length ) ; } else { row [ i ] . cells = row [ i ] . cells . slice ( 0 , frzCols ) ; } } this . isFrzLoad ++ ; return row ; } }