- Minimum card limit
- Maximum card limit
Contact Support
Validation in Angular Kanban component
27 Apr 20242 minutes to read
Validate particular column using the minCount
or maxCount
properties. The corresponding columns gets different appearance when validation fails. In default layout, constraintType
property accept only Column
type. In swimlane layout, accept both Column
and Swimlane
constraint type.
There are two types of constraints:
- Column
- Swimlane
By default, the column count validation is performed based on Kanban columns.
Minimum card limit
The minCount
property is used to specify the minimum cards hold on particular column or swimlane cell. If the column or swimlane total card count falls short of the minimum count value, it shows the column or cell background colour with validation fails.
Maximum card limit
The maxCount
property is used to specify the maximum cards hold on particular column or swimlane cell. If the column or swimlane cell total card count exceeds the maximum count value, it shows the column or cell background colour with validation fails.
import { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
import { KanbanModule } from '@syncfusion/ej2-angular-kanban'
import { Component } from '@angular/core';
import { CardSettingsModel } from '@syncfusion/ej2-angular-kanban';
import { kanbanData } from './datasource';
@Component({
imports: [
KanbanModule
],
standalone: true,
selector: 'app-root',
template: `<ejs-kanban keyField='Status' [dataSource]='data' [cardSettings]='cardSettings'>
<e-columns>
<e-column headerText='To do' keyField='Open' minCount='6'></e-column>
<e-column headerText='In Progress' keyField='InProgress' maxCount='5'></e-column>
<e-column headerText='Testing' keyField='Testing' minCount='3' maxCount='4'></e-column>
<e-column headerText='Done' keyField='Close'></e-column>
</e-columns>
</ejs-kanban>`
})
export class AppComponent {
public data: Object[] = kanbanData;
public cardSettings: CardSettingsModel = {
contentField: 'Summary',
headerField: 'Id'
};
}
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app.component';
import 'zone.js';
bootstrapApplication(AppComponent).catch((err) => console.error(err));