Kanban component - collapse all swimlanes by default

Hi,

I cannot find how to collapse the swimlanes by default on my kanban component.
I can see that it's possible for EJ1 but not for EJ2 ?
Is there any way to do it even if there is no method to do so ?



Thank you


3 Replies 1 reply marked as answer

BS Buvana Sathasivam Syncfusion Team May 23, 2022 07:07 AM UTC

Hi Julien,


Greetings from Syncfusion support.


We have prepared a sample based on your shared query using the dataBound event of the Kanban component. In the below sample, all the swimlanes can be opened and closed using a button and  ‘rowExpandCollapse’ method. We have prepared a sample for your reference.

app.component.html

 <ejs-kanban (dataBound)="dataBound()">

    </ejs-kanban>


app.component.ts

public dataBound(): void {

    if (this.isInitialRender) {

      this.OpenCloseSwimlane();

      this.isInitialRender = false;

    }

  }

  public OpenCloseSwimlane(): void {

    var currentSwimlanes;

    if (this.isOpenSwimlane) {

      var currentSwimlanes = this.kanbanObj.element.querySelectorAll(

        '.e-swimlane-row:not(.e-collapsed)'

      );

      this.isOpenSwimlane = false;

    } else {

      var currentSwimlanes = this.kanbanObj.element.querySelectorAll(

        '.e-swimlane-row.e-collapsed'

      );

      this.isOpenSwimlane = true;

    }

    for (var i = 0i < currentSwimlanes.lengthi++) {

      this.kanbanObj.actionModule.rowExpandCollapse(currentSwimlanes[i]);

    }

  }


Sample: https://stackblitz.com/edit/angular-y6g5bk-z5fkgy?file=app.component.ts,app.component.html,package.json


API link: https://ej2.syncfusion.com/angular/documentation/api/kanban#databound


Regards,

Buvana S


Marked as answer

JB Julien Boye May 23, 2022 09:03 AM UTC

Hi Buvana,

Thank you very much for your quick answer, it works perfectly !

Have a nice day,

Julien



BS Buvana Sathasivam Syncfusion Team May 24, 2022 06:00 AM UTC

Thank you for your update. Please let us know if you need any further assistance.


Loader.
Up arrow icon