Skip to content
This repository was archived by the owner on Jun 1, 2025. It is now read-only.

Commit e0f7b53

Browse files
committed
refactor: lint code and add missing types
1 parent fe71086 commit e0f7b53

4 files changed

Lines changed: 6 additions & 9 deletions

File tree

src/app/examples/grid-colspan.component.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ export class GridColspanComponent implements OnInit {
5454
this.gridOptions1 = {
5555
enableAutoResize: false,
5656
enableCellNavigation: true,
57+
enableExport: true,
5758
enableSorting: true,
5859
createPreHeaderPanel: true,
5960
showPreHeaderPanel: true,

src/app/modules/angular-slickgrid/services/excelExport.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ export class ExcelExportService {
508508

509509
let colspan = 1;
510510
let colspanColumnId;
511-
if (itemMetadata) {
511+
if (itemMetadata?.columns) {
512512
const metadata = itemMetadata?.columns;
513513
const columnData = metadata[columnDef.id] || metadata[col];
514514
if (!(prevColspan > 1 || (prevColspan === '*' && col > 0))) {

src/app/modules/angular-slickgrid/services/export-utilities.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function exportWithFormatterWhenDefined(row: number, col: number, dataCon
3030
formatter = columnDef.exportCustomFormatter;
3131
} else if (isEvaluatingFormatter && columnDef.formatter) {
3232
// or else do we have a column Formatter AND are we evaluating it?
33-
formatter = columnDef.formatter
33+
formatter = columnDef.formatter;
3434
}
3535

3636
if (typeof formatter === 'function') {

src/app/modules/angular-slickgrid/services/export.service.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -349,18 +349,14 @@ export class ExportService {
349349
rowOutputStrings.push(emptyValue);
350350
}
351351

352-
let colspan = 1;
353352
let colspanColumnId;
354-
if (itemMetadata) {
353+
if (itemMetadata?.columns) {
355354
const metadata = itemMetadata?.columns;
356355
const columnData = metadata[columnDef.id] || metadata[col];
357356
if (!(prevColspan > 1 || (prevColspan === '*' && col > 0))) {
358357
prevColspan = columnData?.colspan ?? 1;
359358
}
360-
if (prevColspan === '*') {
361-
colspan = columns.length - col;
362-
} else {
363-
colspan = prevColspan;
359+
if (prevColspan !== '*') {
364360
if (columnDef.id in metadata) {
365361
colspanColumnId = columnDef.id;
366362
}
@@ -370,7 +366,7 @@ export class ExportService {
370366
if ((prevColspan === '*' && col > 0) || (prevColspan > 1 && columnDef.id !== colspanColumnId)) {
371367
rowOutputStrings.push('');
372368
if (prevColspan > 1) {
373-
colspan = (prevColspan as number)--;
369+
(prevColspan as number)--;
374370
}
375371
} else {
376372
// get the output by analyzing if we'll pull the value from the cell or from a formatter

0 commit comments

Comments
 (0)