@@ -95,7 +95,7 @@ import { ContainerService } from '../services/container.service';
9595 ]
9696} )
9797export class AngularSlickgridComponent < TData = any > implements AfterViewInit , OnDestroy {
98- protected _dataset ?: any [ ] | null ;
98+ protected _dataset ?: TData [ ] | null ;
9999 protected _columnDefinitions ! : Column [ ] ;
100100 protected _currentDatasetLength = 0 ;
101101 protected _eventHandler : SlickEventHandler = new SlickEventHandler ( ) ;
@@ -358,7 +358,7 @@ export class AngularSlickgridComponent<TData = any> implements AfterViewInit, On
358358 this . _isGridInitialized = true ;
359359
360360 // recheck the empty warning message after grid is shown so that it works in every use case
361- if ( this . gridOptions && this . gridOptions . enableEmptyDataWarningMessage && Array . isArray ( this . dataset ) ) {
361+ if ( this . gridOptions ? .enableEmptyDataWarningMessage && Array . isArray ( this . dataset ) ) {
362362 const finalTotalCount = this . dataset . length ;
363363 this . displayEmptyDataWarning ( finalTotalCount < 1 ) ;
364364 }
@@ -789,7 +789,7 @@ export class AngularSlickgridComponent<TData = any> implements AfterViewInit, On
789789 newColumnDefinitions = this . swapInternalEditorToSlickGridFactoryEditor ( newColumnDefinitions ) ;
790790
791791 if ( this . gridOptions . enableTranslate ) {
792- this . extensionService . translateColumnHeaders ( false , newColumnDefinitions ) ;
792+ this . extensionService . translateColumnHeaders ( undefined , newColumnDefinitions ) ;
793793 } else {
794794 this . extensionService . renderColumnHeaders ( newColumnDefinitions , true ) ;
795795 }
@@ -835,19 +835,15 @@ export class AngularSlickgridComponent<TData = any> implements AfterViewInit, On
835835 // translate some of them on first load, then on each language change
836836 if ( gridOptions . enableTranslate ) {
837837 this . extensionService . translateAllExtensions ( ) ;
838- this . translateColumnHeaderTitleKeys ( ) ;
839- this . translateColumnGroupKeys ( ) ;
840838 }
841839
842840 this . subscriptions . push (
843- this . translate . onLangChange . subscribe ( ( ) => {
841+ this . translate . onLangChange . subscribe ( ( { lang } ) => {
844842 // publish event of the same name that Slickgrid-Universal uses on a language change event
845843 this . _eventPubSubService . publish ( 'onLanguageChange' ) ;
846844
847845 if ( gridOptions . enableTranslate ) {
848- this . extensionService . translateAllExtensions ( ) ;
849- this . translateColumnHeaderTitleKeys ( ) ;
850- this . translateColumnGroupKeys ( ) ;
846+ this . extensionService . translateAllExtensions ( lang ) ;
851847 if ( gridOptions . createPreHeaderPanel && ! gridOptions . enableDraggableGrouping ) {
852848 this . groupingService . translateGroupingAndColSpan ( ) ;
853849 }
@@ -1407,16 +1403,6 @@ export class AngularSlickgridComponent<TData = any> implements AfterViewInit, On
14071403 } ) ;
14081404 }
14091405
1410- protected translateColumnHeaderTitleKeys ( ) {
1411- // translate all columns (including hidden columns)
1412- this . extensionUtility . translateItems ( this . sharedService . allColumns , 'nameKey' , 'name' ) ;
1413- }
1414-
1415- protected translateColumnGroupKeys ( ) {
1416- // translate all column groups (including hidden columns)
1417- this . extensionUtility . translateItems ( this . sharedService . allColumns , 'columnGroupKey' , 'columnGroup' ) ;
1418- }
1419-
14201406 /**
14211407 * Update the "internalColumnEditor.collection" property.
14221408 * Since this is called after the async call resolves, the pointer will not be the same as the "column" argument passed.
0 commit comments