diff --git a/src/data-sources/array-data-source.ts b/src/data-sources/array-data-source.ts index 6a5332b..be8a72b 100644 --- a/src/data-sources/array-data-source.ts +++ b/src/data-sources/array-data-source.ts @@ -17,7 +17,7 @@ export class ArrayDataSource extends DataSource { * * @param array The array. */ - public constructor(array: TEntry[]) { + public constructor(array: TEntry[] = []) { super(array); } diff --git a/src/data-sources/table-data-source.ts b/src/data-sources/table-data-source.ts index 3c0bd3a..05bd8cb 100644 --- a/src/data-sources/table-data-source.ts +++ b/src/data-sources/table-data-source.ts @@ -40,11 +40,18 @@ export class TableDataSource extends ArrayDataSource { /** * Creates a new TableDataSource with the supplied array. * - * @param array The array. + * @param array The original array. + * @param filtering Whether filtering should be active. + * @param sorting Whether the sorting should be active. + * @param paging Whether the paging should be active. */ - public constructor(array: TRow[]) { + public constructor(array: TRow[] = [], filtering: boolean = true, sorting: boolean = true, paging: boolean = true) { super(array); + this.filterProcessor.active = filtering; + this.sorterProcessor.active = sorting; + this.pagerProcessor.active = paging; + this.preprocessors.addProcessor(this.filterProcessor); this.preprocessors.addProcessor(this.sorterProcessor); this.preprocessors.addProcessor(this.pagerProcessor);