How to disable add or edit or swim lanes in Kanban depending on specific case or specific value

Hi,

Q1- How to disable add or edit or swim lanes  in Kanban depending on specific case or specific value?


Thank you very much


1 Reply

IS Indrajith Srinivasan Syncfusion Team August 16, 2021 12:41 PM UTC

Hi Ahmed, 
 
Greetings from Syncfusion support, 
 
We have validated you reported query, you can add, remove, edit and disable the swimlane setting by the following ways in the dataBinding and queryCellInfo events of the Kanban component. You can perform your actions based on condition, when the data is being loaded for the Kanban component. Check the below shared component and code blocks for reference. 
 
Code blocks:  
 
 
<ejs-kanban id="Kanban" keyField="Status" dataSource="@ViewBag.data" dataBinding="onbind" queryCellInfo="onQuerybind"> 
    <e-kanban-columns> 
        <e-kanban-column headerText="To Do" keyField="Open"></e-kanban-column> 
        <e-kanban-column headerText="In Progress" keyField="InProgress"></e-kanban-column> 
        <e-kanban-column headerText="Testing" keyField="Testing"></e-kanban-column> 
        <e-kanban-column headerText="Done" keyField="Close"></e-kanban-column> 
    </e-kanban-columns> 
    <e-kanban-cardsettings contentField="Summary" headerField="Title"></e-kanban-cardsettings> 
    <e-kanban-swimlanesettings keyField="Assignee"></e-kanban-swimlanesettings> 
</ejs-kanban> 
 
 
function onbind() { 
    this.swimlaneSettings.sortComparer = sortComparer; 
} 
function sortComparer(args) { 
    // Add data in swimlane; 
    var s = { keyField: "Janet"textField: "testing" }; 
    args.push(s); 
 
    // Remove data in swimlane 
    args.splice(11); 
 
    // Edit textcontent in the swimlane 
    args[3].textField = "changed"; 
    return args; 
} 
 
// Disbale particular swimlane 
function onQuerybind(args) { 
    if (args.requestType = "swimlaneRow" || args.requestType === "contentRow") { 
        if (args.data[0].keyField === "Janet Leverling") { 
            args.element.classList.add('e-disabled'); 
        } 
    } 
} 
 
 
 
 
Can you please check the above sample, and let us know if it meets your requirements ? 
 
Regards, 
Indrajith 


Loader.
Up arrow icon