File tree 3 files changed +10
-7
lines changed
src/app/modules/angular-slickgrid/editors
3 files changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -88,10 +88,9 @@ export class DateEditor implements Editor {
88
88
89
89
getCurrentLocale ( columnDef : Column , gridOptions : GridOption ) {
90
90
const options = gridOptions || columnDef . params || { } ;
91
- if ( options . i18n && options . i18n instanceof TranslateService ) {
91
+ if ( options && options . i18n instanceof TranslateService ) {
92
92
return options . i18n . currentLang ;
93
93
}
94
-
95
94
return 'en' ;
96
95
}
97
96
Original file line number Diff line number Diff line change @@ -33,7 +33,9 @@ export class LongTextEditor implements Editor {
33
33
constructor ( private args : any ) {
34
34
this . gridOptions = this . args . grid . getOptions ( ) as GridOption ;
35
35
const options = this . gridOptions || this . args . column . params || { } ;
36
- this . _translate = options . i18n ;
36
+ if ( options && options . i18n instanceof TranslateService ) {
37
+ this . _translate = options . i18n ;
38
+ }
37
39
38
40
this . init ( ) ;
39
41
}
@@ -61,8 +63,8 @@ export class LongTextEditor implements Editor {
61
63
const columnId = this . columnDef && this . columnDef . id ;
62
64
const placeholder = this . columnEditor && this . columnEditor . placeholder || '' ;
63
65
const title = this . columnEditor && this . columnEditor . title || '' ;
64
- const cancelText = this . _translate && this . _translate . instant ( 'CANCEL' ) || Constants . TEXT_CANCEL ;
65
- const saveText = this . _translate && this . _translate . instant ( 'SAVE' ) || Constants . TEXT_SAVE ;
66
+ const cancelText = this . _translate && this . _translate . instant && this . _translate . instant ( 'CANCEL' ) || Constants . TEXT_CANCEL ;
67
+ const saveText = this . _translate && this . _translate . instant && this . _translate . instant ( 'SAVE' ) || Constants . TEXT_SAVE ;
66
68
const $container = $ ( 'body' ) ;
67
69
68
70
this . $wrapper = $ ( `<div class="slick-large-editor-text editor-${ columnId } " />` ) . appendTo ( $container ) ;
Original file line number Diff line number Diff line change @@ -77,8 +77,10 @@ export class SelectEditor implements Editor {
77
77
78
78
constructor ( protected args : any , protected isMultipleSelect ) {
79
79
this . gridOptions = this . args . grid . getOptions ( ) as GridOption ;
80
- const gridOptions = this . gridOptions || this . args . column . params || { } ;
81
- this . _translate = gridOptions . i18n ;
80
+ const options = this . gridOptions || this . args . column . params || { } ;
81
+ if ( options && options . i18n instanceof TranslateService ) {
82
+ this . _translate = options . i18n ;
83
+ }
82
84
83
85
// provide the name attribute to the DOM element which will be needed to auto-adjust drop position (dropup / dropdown)
84
86
const fieldId = this . columnDef && this . columnDef . id ;
You can’t perform that action at this time.
0 commit comments