Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | 3x 3x 3x 3x 24x 24x 24x 24x 24x 76x 2x 1x 1x 1x 2x 2x 2x 6x 5x 5x 1x 25x 2x 1x 1x 2x 1x | import { DataTable } from "./DataTable";
import { mhaStrings } from "../mhaStrings";
import { Header } from "../row/Header";
import { OtherRow } from "../row/OtherRow";
export class Other extends DataTable {
private otherRows: OtherRow[] = [];
protected sortColumnInternal = "number";
protected sortOrderInternal = 1;
public readonly tableName: string = "otherHeaders";
public readonly displayName: string = mhaStrings.mhaOtherHeaders;
public get rows(): OtherRow[] { return this.otherRows; }
public override doSort(col: string): void {
if (this.sortColumnInternal === col) {
this.sortOrderInternal *= -1;
} else {
this.sortColumnInternal = col;
this.sortOrderInternal = 1;
}
Iif (this.rows[0] && this.sortColumnInternal + "Sort" in this.rows[0]) {
col = col + "Sort";
}
this.rows.sort((a: OtherRow, b: OtherRow) => {
return this.sortOrderInternal * ((a[col] as string | number) < (b[col] as string | number) ? -1 : 1);
});
}
public add(header: Header): boolean {
if (header.header || header.value) {
this.rows.push(new OtherRow(
this.rows.length + 1,
header.header,
header.value));
return true;
}
return false;
}
public override exists() { return this.rows.length > 0; }
public override toString() {
if (!this.exists()) return "";
const ret: string[] = ["Other"];
this.rows.forEach(function (row) {
Eif (row.value) { ret.push(row.value); }
});
return ret.join("\n");
}
}
|