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.

How to capture the current status of drag and drop card.

Thread ID:

Created:

Updated:

Platform:

Replies:

130179 Apr 26,2017 09:58 AM Apr 27,2017 12:58 PM ASP.NET Web Forms 1
loading
Tags: Kanban
Ramesh Sadam
Asked On April 26, 2017 09:58 AM

Dear Sir/Madam,

After drag and drop kanban card.How to capture and save the status of card.

For example: Drag and drop the card from Open status to close status. Now, want to capture the current status of card and save it and reload it with current status.

Thank you.

Buvana Sathasivam [Syncfusion]
Replied On April 27, 2017 12:58 PM

Hi Ramesh Sadam, 

Thanks for using Syncfusion product. 

We had prepared Kanban sample with CRUD operations using ejDataManager.  DataManager fully supports the CRUD operatons.  In remote CRUD operations, the data should be retrieved from and submitted to a remote data service via HTTP request made by the DataManager.  URL property is used to load data into Kanban and CrudURL property is used to get post action for processing adding/editing/deleting/updating data’s.  You can use below solution for CRUD actions. 

KanbanFeatures.aspx 

<ej:Kanban ID="Kanban" runat="server" KeyField="Status" AllowTitle="true"> 
                <DataManager URL="KanbanFeatures.aspx/GetData"  //To load Kanban          CrudURL="KanbanFeatures.aspx/Crud"     //To perform CRUD operations 
Adaptor="WebMethodAdaptor" />         // Define the adaptor 
           ……. 
</ej:Kanban> 

KanbanFeatures.aspx.cs 

[WebMethod] 
        [ScriptMethod(ResponseFormat = ResponseFormat.Json)] 
        public static object GetData(Syncfusion.JavaScript.DataManager value) // To render all Kanban cards 
        { 
            NORTHWNDEntities1 db = new NORTHWNDEntities1(); 
            IEnumerable Data = db.Tasks.ToList(); 
            int count = Data.AsQueryable().Count(); 
            Syncfusion.JavaScript.DataSources.DataOperations operation = new Syncfusion.JavaScript.DataSources.DataOperations(); 
            Data = operation.Execute(Data, value); 
            return new { result = Data, count = count }; 
        } 
        [WebMethod] 
        [ScriptMethod(ResponseFormat = ResponseFormat.Json)] 
 
        public static object Crud(string key, List<Task> changed, List<Task> added, List<Task> deleted) //Add,Edit,Delete Kanban cards 
        { 
            NORTHWNDEntities1 db = new NORTHWNDEntities1(); 
 
            //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)  // Here single updated data was send to temp variable 
                { 
                    Task old = db.Tasks.Where(o => o.Id == temp.Id).SingleOrDefault(); // Get old data from database table 
                    if (old != null) 
                    { 
                        db.Entry(old).CurrentValues.SetValues(temp); // Set updated data into old data 
                    } 
                } 
            } 
 
            //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(); // Save updated data on database 
            var dataSource = db.Tasks.ToList(); 
            return dataSource; 
        } 





Regards, 
Buvana S. 
 


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.

;