path: string;
label: string;
headerLabel: string;
- flex: number;
align: string;
hidden: boolean;
visible: boolean;
col.name = this.name;
col.path = this.path;
col.label = this.label;
- col.flex = this.flex;
col.required = this.required;
col.hidden = this.hidden;
col.asyncSupportsEmptyTermClick = this.asyncSupportsEmptyTermClick;
reset() {
this.columns.forEach(col => {
- col.flex = 2;
col.sort = 0;
col.align = '';
col.visible = this.stockVisible.includes(col.name);
}
if (!col.name) { col.name = col.path; }
- if (!col.flex) { col.flex = 2; }
if (!col.align) { col.align = ''; }
if (!col.label) { col.label = col.name; }
if (!col.datatype) { col.datatype = 'text'; }
return this.displayColumns().map(col => {
const c: GridColumnPersistConf = {name : col.name};
if (col.align !== '') { c.align = col.align; }
- if (col.flex !== 2) { c.flex = Number(col.flex); }
if (Number(col.sort)) { c.sort = Number(col.sort); }
return c;
});
col.visible = true;
if (colConf.align) { col.align = colConf.align; }
- if (colConf.flex) { col.flex = Number(colConf.flex); }
if (colConf.sort) { col.sort = Number(colConf.sort); }
// Add to new columns array, avoid dupes.
export class GridColumnPersistConf {
name: string;
- flex?: number;
sort?: number;
align?: string;
}