import {Widget, DatasourceConfiguration} from "../../Widget";

export class TableWidget extends Widget {
    datasourceConfiguration?: DatasourceConfiguration = new DatasourceConfiguration();
    rowSelectable?: boolean;
    rowSelectColumn?: string;
    rowSelectParamName?: string;
    selectedColumns?: string[];
    editable?: boolean;
    formCode?: string;
    formColumnId?: string;
    formColumnTitle?: string;
    rowSelectTarget?: string;

    public constructor(init?: Partial<TableWidget>) {
        super();        
        Object.assign(this, init);
        this.type = "TABLE";
        this.rowSelectable = false;
        this.editable = false;
        this.selectedColumns = [];
        if (!this.datasourceConfiguration)
            this.datasourceConfiguration = new DatasourceConfiguration();
    }
}