Styling

How to color code the cards?
And how to use templates
And want to show dialog for Edit

How do we handle events when moved to a swim lane?
Can we color code columns?
 <e-column headerText='Pending' keyField='Open'>e-column>

5 Replies 1 reply marked as answer

BS Balasubramanian Sattanathan Syncfusion Team December 21, 2020 10:32 AM UTC

Hi Vin, 

Greetings from Syncfusion Support. 

We have validated your requirements at our end and prepared a sample based on that. In the below sample, we have added a template for card and changed card color using below the CSS.  


.e-kanban .e-kanban-header .e-header-cells, 
.e-kanban .e-kanban-content .e-content-row .e-content-cells .e-card-wrapper .e-card, 
.e-kanban .e-kanban-content .e-content-row .e-content-cells .e-card-wrapper .e-card .e-card-content { 
    background-color: darkgrey; 
} 


And also let you know that we can color the left border of card by using the grabberField like the below sample. 

public cardSettings: CardSettingsModel = { 
    contentField: 'Summary', 
    headerField: 'Id', 
    tagsField: 'Tags', 
    grabberField: 'Color', 
    footerCssField: 'ClassName' 
}; 


Kindly try the above links and let us know if you need further assistance. 

Regards, 
Balasubramanian S 



VI vin January 4, 2021 03:42 AM UTC


What all events can i use to capture when i move between swimlanes?
And how to undo swimlane change?

How do i control the edit card fields ?
how do i make them readonly or have validation for fields?
And can i remove delete option?
Can i add a link on edit mode so user can navigate to the details of this item?





BS Balasubramanian Sattanathan Syncfusion Team January 4, 2021 11:36 AM UTC

Hi Vin, 

Kindly find below responses for your query. 

What all events can i use to capture when i move between swimlanes? And how to undo swimlane change? 
We have validated your query at our end and suspect that your need is to capture the changed cards. We can take the moved card details by making use of the dragStop event. 
onDragStop(args) { 
  // Here, we can capture the card details which has been moved 
  console.log(args.data[0]); 

How do i control the edit card fields ? 
We have validated your query at our end and suspect that your need is to prevent the dialog from its opening. So we suggest you to refer the below UG to know more details about the card fields and preventing dialog. 


how do i make them readonly or have validation for fields? 
We can achieve readonly for fields by using the open event of the Dialog component and dialogOpen of the event. 
onDialogOpen(args: any) { 
  args.element.ej2_instances[0].open = this.onOpen; 
  let validator: any = args.element.querySelector('.e-kanban-form').ej2_instances[0]; 
  validator.rules = { 
    Summary: { required: true } 
  }; 
  validator.dataBind(); 
onOpen(args) { 
  args.element.querySelector('#Status').ej2_instances[0].readonly = true; 
  args.element.querySelector('#Assignee').ej2_instances[0].readonly = true; 
  args.element.querySelector('#Priority').ej2_instances[0].readonly = true; 

And can i remove delete option? 
We can remove the delete button by using the below CSS. 
.e-kanban-dialog .e-dialog-delete { 
  display: none !important; 
} 
 
Can i add a link on edit mode so user can navigate to the details of this item? 
We can add a link in the dialog window by using the dialogTemplate like below. 
<tr> 
  <td class="e-label">Link</td> 
  <td> 
    <div class="e-float-input e-control-wrapper"> 
      <a rel='nofollow' href="https://ej2.syncfusion.com/angular/demos/#/material/kanban/overview" target="_blank">Kanban Overview</a> 
    </div> 
  </td> 
</tr> 


Kindly try the above solution and let us know if you need further assistance. 

Regards, 
Balasubramanian S 



VI vin January 5, 2021 05:04 AM UTC

How do i cancel my event if i get any error in my API
I want to reset my drag drop to my original state

onDragStop(args) { 
  // Here, we can capture the card details which has been moved 
  console.log(args.data[0]); 



What other icons  we can use for header, can we customize them?
Where do i lookup?




My data is getting hidden
Can we make the cards  fixed width or maybe scroll in the bottom?



BS Balasubramanian Sattanathan Syncfusion Team January 5, 2021 12:38 PM UTC

Hi Vin, 

Thanks for the update. 

How do i cancel my event if i get any error in my API 
I want to reset my drag drop to my original state 
We can cancel the event based on the conditions by providing args.cancel as true like below code snippet. 
onDragStop(args) { 
    // Here, we can capture the card details which has been moved 
    console.log(args.data[0]); 
    if (this.flag) { // If the flag value is true, the drag/drop action will be cancelled 
      args.cancel = true; // Here, we can cancel the drag/drop action 
   

What other icons  we can use for header, can we customize them? 
Where do i lookup? 
We have validated your requirement at our end and we suggest you to refer the below UG to know more details about the available icons and its usage steps. 
 
My data is getting hidden 
Can we make the cards  fixed width or maybe scroll in the bottom? 
We can change the width of the Kanban cards by using the below CSS. 
.e-kanban .e-kanban-content .e-content-row .e-content-cells .e-card-wrapper .e-card { 
  width: 120%; /*If we use more than 100% the scroller will be render automatically */ 
} 
 

Kindly try the above solution and let us know if this is helpful. 

Regards, 
Balasubramanian S 


Marked as answer
Loader.
Up arrow icon