Can Kanban Support Multiple Models/Data Models?

Can Kanban support data binding from multiple models that are linked together?

An example would be we have a Address Model that has a list of People that are derived from the People Model.

Can Kanban display two different types of lists?


6 Replies

BS Buvana Sathasivam Syncfusion Team February 28, 2022 02:45 PM UTC

Hi Dylan, 

Greetings from Syncfusion support. 
Yes. It is possible to map the complex properties to Kanban fields like KeyField, KanbanCardSettings, KanbanSwimlaneSettings properties etc. 


Please let us know if you have any further assistance. 

Regards, 
Buvana S 



DY Dylan March 3, 2022 04:25 AM UTC

Thank you Buvane.
My other questions are even after reading the documentation I'm unsure how I would save my data back to my database?

What is called when the adding buttons are clicked above each column?

What is called when I click save in the Dialog edit box?

In the Syncfusion Grids I go about it like this:

public async void ActionBeginHandler(ActionEventArgs Args)

{

if (Args.RequestType.Equals(Syncfusion.Blazor.Grids.Action.Save))

{

if (Args.Action == "Add")

{

await ApprasialService.AddApprasial(Args.Data);

Apprasials = (await ApprasialService.GetAllApprasials()).ToList();

ApprasialGrid.Refresh();

}

else

{

await ApprasialService.UpdateApprasial(Args.Data);

}

}

if (Args.RequestType.Equals(Syncfusion.Blazor.Grids.Action.Delete))

{

await ApprasialService.DeleteApprasial(Args.Data.Id);

}

}


The below code here is how I am retrieving the data from my Appraisals into the dialog box.


@*

@{

var data = (Apprasial)context;

Address:@data.Address.StreetAddress.ToString()
County:@data.Address.County.ToString()
Zip:@data.Address.Zip.ToString()
Key:@data.Address.WhereIsKey.ToString()

}

*@



DY Dylan March 3, 2022 04:30 AM UTC

I apologize but your word editor won't let me past in the code snippet.






BS Buvana Sathasivam Syncfusion Team March 5, 2022 03:37 PM UTC

  
Hi Dylan, 
 
Query #1: “What is called when the adding buttons are clicked above each column?” 
 
The DialogOpen event is triggered when you click above the add button in each column. Please find the below code. 
 
<SfKanban TValue="SwimlaneTasksModel"> 
   <KanbanEvents TValue="SwimlaneTasksModel" DialogOpen="OnDialogOpen" /> 
</SfKanban> 
 
@code { 
     
    private void OnDialogOpen(DialogOpenEventArgs<SwimlaneTasksModel> args) 
    { 
        // Here, you can get the args.Data before open the dialog 
    } 
} 
 
 
 
Query #2: “What is called when I click save in the Dialog edit box?” 
 
The DialogClose event is triggered before saving the data into the Kanban board, and the ActionComplete event is triggered after saving the dialog data into the Kanban board. 
 
<SfKanban TValue="SwimlaneTasksModel"> 
   <KanbanEvents TValue="SwimlaneTasksModel" DialogClose="OnDialogClose" ActionComplete="OnActionComplete"/> 
</SfKanban> 
 
@code { 
    private void OnDialogClose(DialogCloseEventArgs<SwimlaneTasksModel> args) 
    { 
    } 
    private void OnActionComplete(ActionEventArgs<SwimlaneTasksModel> args) 
    { 
        // Here, you can get the args.Data after saving data 
    } 
} 
 
  
 
 
 
Query #3: “your word editor wont let me past in the code snippet” 
 
Can you please share more information or a video about your requirements? So, we will check and provide the solution as soon as possible. 
 
 
Regards,  
Buvana  



DY Dylan March 9, 2022 01:27 PM UTC

 Buvana,


Thank you for your time with answering my questions.
Unfortunately I'm still encountering trouble.

The most prominent issue I'm facing is my cards will not drag over to the next status column and save.

In-fact the cards bounce back to where I drag them from.  I'm not sure if this is how I get my data from the database and how I update it or something else I am missing.  I get my data through restful services which are injected into the Kanban page with the data being retrieved by properties and stored into lists.

I have tried the DragStop event and ActionComplete with numerous attempts but have had no luck.
The status I am binding to in the KeyField is a unmapped property in my model that returns the status of a card.

How would I go about matching that status with the statuses I bind to?  Attached are snippets of my kanban page I hope make sense in what I am trying to explain.


The current Kanban Event of DragStop I am trying.

kanbanTwo.png

This is how I am saving my updated data through my Dialog Edit after double clicking a card.
kanbanThree.png

This is what I've been bouncing between on for updating the card status on drag with no luck.  The commented out code has been tried.

tryUpdateKanBanDrag.png

And this is what my statuses/keyfields look like.
sfkanban11.png

Thank you for all of your assistance and future help as well for this matter.



BS Buvana Sathasivam Syncfusion Team March 11, 2022 09:15 AM UTC

Hi Dylan,


Thank you for your update.


You will be able to get the data from the database and render the Kanban board using Adaptors. We suggest using adaptors to retrieve data from a database and update changes in your database. You should be able to meet your requirements by using customAdaptor. Please see below the documentation for various adaptors.


Documentation: https://blazor.syncfusion.com/documentation/kanban/data-binding#using-custom-adaptor


Sample: https://github.com/SyncfusionExamples/blazor-kanban-crud-custom-adaptor


Please let us know if you have any other concerns.


Regards,

Buvana S


Loader.
Up arrow icon