Hi Matias,
Thanks for the update.
We have validated your reported query “Is there a way to do it dynamically?” at our end. We have achieved your requirement with the help of the queryCellInfo and dataBinding event of the Schedule like the below code. We have prepared a sample for your reference and it can be available below.
[app.component.ts]
export class AppComponent {
@ViewChild('kanbanObj') kanbanObj: KanbanComponent;
public kanbanData: Object[] = extend([], kanbanData, null, true) as Object[];
public cardSettings: CardSettingsModel = {
contentField: 'Summary',
headerField: 'Id',
tagsField: 'Tags',
grabberField: 'Color',
footerCssField: 'ClassName'
};
public isHeaderSet: boolean = false;
public isContentSet: boolean = false;
public onQueryCellInfo(args) {
let isHeader = !this.isHeaderSet && args.requestType === "headerRow";
let isContent = !this.isContentSet && args.requestType === "contentRow";
if (isHeader || isContent) {
let className = args.requestType === "headerRow" ? '.e-header-table' : '.e-content-table';
let colGroup = (this.kanbanObj as any).element.querySelector(className).firstChild;
let count = colGroup.childElementCount;
let individualWidth = window.innerWidth / count;
for (let i = 0; i < count; i++) {
colGroup.children[i].style.width = (individualWidth - 16) + "px";
}
if(isHeader)
this.isHeaderSet = true;
if(isContent)
this.isContentSet = true;
}
}
public addColumn(args) {
this.isHeaderSet = false;
this.isContentSet = false;
(this.kanbanObj as any).addColumn({ headerText: 'Test Column', keyField: 'Test' }, 4);
args.currentTarget.ej2_instances[0].disabled = true;
}
public onDataBinding(args) {
this.isHeaderSet = false;
this.isContentSet = false;
}
}
Kindly try the above sample and get back to us if you need any further assistance.
Regards,
Ravikumar Venkatesan