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?
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
{
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;
|
}
*@
@{ Apprasial data = (Apprasial)context; @if(data.Address.WhereIsKey == null) { } else { } @if (data.StatusString == "Inspected" || data.StatusString == "In Progress" || data.StatusString == "Awaiting Payment" || data.StatusString == "Paid") { } Value="@data.Address.StreetAddress.ToString()" Enabled="true" /> }Appraisal ID Address County Zip Where Is Key Where Is Key Contact Status Ammount For Appraisal Due Date Inspection Date Type Rush Order?
I apologize but your word editor won't let me past in the code snippet.
|
<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
}
}
|
|
<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
}
} |
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.
This is how I am saving my updated data through my Dialog Edit after double clicking a card.
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.
And this is what my statuses/keyfields look like.
Thank you for all of your assistance and future help as well for this matter.
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