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

Commit bd54f7b

Browse files
committed
feat: add setSource
1 parent 75785a9 commit bd54f7b

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

projects/table-builder/src/lib/table/table-builder.api.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,8 @@ export abstract class TableBuilderApiImpl
338338
});
339339
}
340340

341+
public abstract setSource(source: TableRow[]): void;
342+
341343
public abstract markDirtyCheck(): void;
342344

343345
public abstract markForCheck(): void;

projects/table-builder/src/lib/table/table-builder.component.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ import { catchError, takeUntil } from 'rxjs/operators';
2424
import { NGX_ANIMATION } from './animations/fade.animation';
2525
import { NgxColumnComponent } from './components/ngx-column/ngx-column.component';
2626
import { TABLE_GLOBAL_OPTIONS } from './config/table-global-options';
27-
import { CalculateRange, ColumnsSchema } from './interfaces/table-builder.external';
27+
import { CalculateRange, ColumnsSchema, TableRow } from './interfaces/table-builder.external';
2828
import { Any, KeyMap, RecalculatedStatus, TableSimpleChanges, TemplateKeys } from './interfaces/table-builder.internal';
2929
import { detectChanges } from './operators/detect-changes';
3030
import { ContextMenuService } from './services/context-menu/context-menu.service';
@@ -321,6 +321,11 @@ export class TableBuilderComponent extends TableBuilderApiImpl
321321
this.viewPortInfo.bufferOffset = bufferOffset;
322322
}
323323

324+
public setSource(source: TableRow[]): void {
325+
this.originalSource = source;
326+
this.source = source;
327+
}
328+
324329
protected calculateViewPortByRange({ start, end, bufferOffset, force }: CalculateRange): void {
325330
if (this.startIndexIsNull()) {
326331
this.updateViewportInfo(start, end);

0 commit comments

Comments
 (0)