Skip to content

Commit

Permalink
fix: sync row defatil grid option to fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding committed Dec 30, 2023
1 parent 1cea0dc commit 870cf47
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/app/examples/grid-contextmenu.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ const priorityExportFormatter: Formatter = (row, cell, value, columnDef, dataCon
};

const taskTranslateFormatter: Formatter = (row, cell, value, columnDef, dataContext, grid) => {
const gridOptions = grid?.getOptions?.() as GridOption;
const gridOptions = grid.getOptions() as GridOption;
const translate = gridOptions.i18n;

return translate && translate.instant && translate.instant('TASK_X', { x: value });
Expand Down
2 changes: 1 addition & 1 deletion src/app/examples/grid-editor.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const URL_COUNTRY_NAMES = 'assets/data/country_names.json';
const myCustomTitleValidator: EditorValidator = (value: any, args?: EditorArguments) => {
// you can get the Editor Args which can be helpful, e.g. we can get the Translate Service from it
const grid = args && args.grid;
const gridOptions = (grid?.getOptions?.() ?? {}) as GridOption;
const gridOptions = (grid?.getOptions() ?? {}) as GridOption;
const translate = gridOptions.i18n;

// to get the editor object, you'll need to use "internalColumnEditor"
Expand Down
2 changes: 1 addition & 1 deletion src/app/examples/grid-localization.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ const NB_ITEMS = 1500;

// create a custom translate Formatter (typically you would move that a separate file, for separation of concerns)
const taskTranslateFormatter: Formatter = (row, cell, value, columnDef, dataContext, grid) => {
const gridOptions = grid?.getOptions?.() as GridOption;
const gridOptions = grid.getOptions() as GridOption;
const translate = gridOptions.i18n as TranslateService;

return translate.instant('TASK_X', { x: value });
Expand Down
2 changes: 1 addition & 1 deletion src/app/examples/grid-range.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function randomBetween(min: number, max: number): number {

// create a custom translate Formatter (typically you would move that a separate file, for separation of concerns)
const taskTranslateFormatter: Formatter = (row, cell, value, columnDef, dataContext, grid) => {
const gridOptions = grid?.getOptions?.() as GridOption;
const gridOptions = grid.getOptions() as GridOption;
const translate = gridOptions.i18n as TranslateService;

return translate.instant('TASK_X', { x: value });
Expand Down
2 changes: 1 addition & 1 deletion src/app/examples/grid-tree-data-hierarchical.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ export class GridTreeDataHierarchicalComponent implements OnInit {
}

treeFormatter: Formatter = (_row, _cell, value, _columnDef, dataContext, grid) => {
const gridOptions = grid.getOptions() as GridOption;
const gridOptions = grid.getOptions();
const treeLevelPropName = gridOptions.treeDataOptions && gridOptions.treeDataOptions.levelPropName || '__treeLevel';
if (value === null || value === undefined || dataContext === undefined) {
return '';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,4 @@ export interface RowDetailView extends UniversalRowDetailView {

/** View Component that will be loaded in the row detail after the async function completed */
viewComponent: Type<object>;

// --
// Callback Methods

/**
* HTML Preload Template that will be used before the async process (typically used to show a spinner/loading)
* It's preferable to use the "preloadView" property to use an Angular View instead of plain HTML.
* If you still wish to use these methods, we strongly suggest you to sanitize your HTML, e.g. "DOMPurify.sanitize()"
*/
preTemplate?: () => string;

/**
* HTML Post Template (when Row Detail data is available) that will be loaded once the async function finishes
* It's preferable to use the "preloadView" property to use an Angular View instead of plain HTML
* If you still wish to use these methods, we strongly suggest you to sanitize your HTML, e.g. "DOMPurify.sanitize()"
*/
postTemplate?: (item: any) => string;
}

0 comments on commit 870cf47

Please sign in to comment.