We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Workflows not working

Thread ID:

Created:

Updated:

Platform:

Replies:

132772 Sep 20,2017 03:46 AM Sep 21,2017 05:55 AM ASP.NET MVC 1
loading
Tags: Kanban
Musab Adnan Basheer
Asked On September 20, 2017 03:46 AM

This is my view 
@(Html.EJ().Kanban("Subscriptions")
                                   .DataSource(ds => ds.URL(Url.Action("GetData")).Adaptor(AdaptorType.UrlAdaptor))
                                   .IsResponsive(true)
                                   .ClientSideEvents(eve =>
                                   {
                                       eve.CardDrop("changeStatus");
                                   })
                                   .Workflows(workflow =>
                                   {
                                       workflow.Key("RequestToJoin").AllowedTransitions("RequestJoinAccepted,Rejected").Add();
                                       workflow.Key("RequestJoinAccepted").AllowedTransitions("RequestToVerifyContent").Add();
                                       workflow.Key("RequestToVerifyContent").AllowedTransitions("TrialStarted,Started,Rejected").Add();
                                       workflow.Key("TrialStarted").AllowedTransitions("TrialEnd").Add();
                                       workflow.Key("TrialEnd").AllowedTransitions("TrialStarted").Add();
                                       workflow.Key("Started").AllowedTransitions("Ended").Add();
                                       workflow.Key("Ended").AllowedTransitions("Started").Add();
                                   })
                                   .Columns(col =>
                                   {
                                       col.HeaderText("Join Request").Key("RequestToJoin").AllowDrop(false).Add();
                                       col.HeaderText("Join Accepted").Key("RequestJoinAccepted").Add();
                                       col.HeaderText("Join Verify Content").Key("RequestToVerifyContent").Add();
                                       col.HeaderText("Trial Started").Key("TrialStarted").Add();
                                       col.HeaderText("Trial End").Key("TrialEnd").Add();
                                       col.HeaderText("Started").Key("Started").Add();
                                       col.HeaderText("Ended").Key("Ended").Add();
                                       col.HeaderText("Rejected").Key("Rejected").Add();
                                   })
                                  .AllowTitle(true)
                                  .KeyField("Status")
                          .Locale("en-US")
                                  .Fields(field =>
                                  {
                                      field
                                     .Title("Title")
                                     .Content("Content")
                                     .ImageUrl("OrganizationImage")
                                     .PrimaryKey("Id");
                                  })

)

//This is my Action 
 public async Task<JsonResult> GetData(Syncfusion.JavaScript.DataManager value)
        {
            DataResult result = new DataResult();
            DataOperations operation = new DataOperations();
            var subscriptions = db.Subscriptions.IncludeMultiple(a => a.Organization);

            if (subscriptions == null)
            {
                return Json(result, JsonRequestBehavior.AllowGet);
            }
            var list = await subscriptions
                .OrderByDescending(order => order.CreatedDate)
                .ToListAsync();

            var model = new List<KanbanSubscriptionViewModel>();

            foreach (var order in list)
            {
                model.Add(KanbanSubscriptionViewModel.FromSubscription(order));
            }

            result.result = model;
            result.count = model.Count();
            return Json(result, JsonRequestBehavior.AllowGet);
        }


Arun Palaniyandi [Syncfusion]
Replied On September 21, 2017 05:55 AM

 
Hi Musab Adnan Basheer, 

Thanks for contacting Syncfusion support. 

We have validated the shared sample and we can able to reproduce you reported scenario. Hence in order to work with the URL or remote Adptors, at the time of drag and drop the cards we have to add CrudURL for updating the changes in database. So we suggest you to write a function in the controller to do the basic CRUD operations for our Kanban and refer it to CrudURL.  


[View] 

@(Html.EJ().Kanban("Kanban") 
               .DataSource(ds => ds.URL("GetData").CrudURL("Crud").Adaptor(AdaptorType.UrlAdaptor)) 
                   .Columns(col => 
                   { 


[Controller] 

//Edit multiple cards for priority drag and drop 
        public ActionResult Crud(List<Task> changed, List<Task> added, List<Task> deleted) 
        { 
            //Performing insert operation 
            if (added != null && added.Count() > 0) 
            { 
                foreach (var temp in added) 
                { 
                    db.Tasks.Add(temp); 
                } 
            } 
 
            ////Performing update operation 
            if (changed != null && changed.Count() > 0) 
            { 
                foreach (var temp in changed) 
                { 
                    Task old = db.Tasks.Where(o => o.Id == temp.Id).SingleOrDefault(); 
                    if (old != null) 
                    { 
                        db.Entry(old).CurrentValues.SetValues(temp); 
                    } 
                } 
            } 
 
            //Performing delete operation 
            if (deleted != null && deleted.Count() > 0) 
            { 
                foreach (var temp in deleted) 
                { 
                    db.Tasks.Remove(db.Tasks.Where(o => o.Id == temp.Id).SingleOrDefault()); 
                } 
            } 
 
            db.SaveChanges(); 
            var data = db.Tasks.ToList(); 
            return Json(data, JsonRequestBehavior.AllowGet); 
        } 



We have also prepared a simple sample for your reference below. 

Further references, check on this: 

If the provided details does not meet your requirement, please give us with more information that will help us to provide an alternative solution.    
   
Regards,   
Arun P.   



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;