How to save changes with remote data

Do you have an example of how to update data on a kanban control with remote data manager?

8 Replies

RV Ravikumar Venkatesan Syncfusion Team April 3, 2020 02:55 PM UTC

Hi Javier, 
  
Greetings from Syncfusion support. 
  
Based on your requirement we have prepared the below sample. 
  
  
Kindly try the above sample and get back to us If you would require any further assistance. 
  
Regards, 
Ravikumar Venkatesan 



MS Marco Salvatori July 7, 2021 08:45 AM UTC

Hello,

if i wanted to pass parameters through request headers how could i do?

thank you



GK Gunasekar Kuppusamy Syncfusion Team July 8, 2021 03:09 PM UTC

Hi Marco,


Good day to you.


We have validated your reported query "if I wanted to pass parameters through request headers how could I do?"

You can pass additional parameters using the query property. We have prepared a sample for your reference.

Code snippets:

<ejs-kanban id="Kanban" keyField="Status" query="new ej.data.Query().addParams('NewName', 'Open')" >  
        <e-data-manager url="/Home/LoadCard" updateUrl="/Home/UpdateCard" removeUrl="/Home/UpdateCard" insertUrl="/Home/UpdateCard" adaptor="UrlAdaptor" crossDomain="true"></e-data-manager>  
              ...  
    </ejs-kanban>  

  
        [HttpPost]  
        public List<KanbanCard> LoadCard([FromBody]ExtendedDataManagerRequest param)  
        {  
            return _context.KanbanCards.ToList();  
        }  
  
        public class ExtendedDataManagerRequest : DataManagerRequest     //inherit the class to show age as property of DataManager   
        {  
            public string NewName { get; set; }  
        }  

Sample: https://www.syncfusion.com/downloads/support/forum/152901/ze/KANBAN~1-1435088187

Please check the sample and let us know if the solution helps


Regards,
Gunasekar



MS Marco Salvatori July 13, 2021 02:52 PM UTC

good..it works.

but i have a lot a API code with this istructions:

string amministrazione = Request.Headers.FirstOrDefault(e => e.Key == "Amministrazione").Value;

how could i do? (one solution is AJAX call...)


thanks



GK Gunasekar Kuppusamy Syncfusion Team July 14, 2021 04:14 PM UTC

Hi Marco, 

We are currently validating your reported query. We will update the further information within two business days on or before 16th July.

Regards,
Gunasekar



GK Gunasekar Kuppusamy Syncfusion Team July 16, 2021 01:45 PM UTC

Hi Marco,


Good day to you,


We have validated your reported query "I have a lot of API code with this instructions. how could I do?".

We can achieve this requirement using the serialization and deserialization method.

For your reference, we have prepared a sample.

Code snippets:
<ejs-kanban id="Kanban" query="new ej.data.Query().addParams('NewName', data)">
. . .
</ejs-kanban>

<script>
var objValue = { x: "header", y: "content" };
var data = JSON.stringify(objValue);
</script>


HomeController.cs
    SampleData value = JsonSerializer.Deserialize<SampleData>(param.NewName);

Samplehttps://www.syncfusion.com/downloads/support/forum/152901/ze/KANBAN~1-2043703602
Please check the sample and let us know if the solution heps.

Regards,
Gunasekar



MS Marco Salvatori July 20, 2021 01:08 PM UTC

I was looking for something different but that's okay. I'll be using AJAX calls with headers:


headers: { "Authorization": "Bearer " + sessionStorage.getItem("Token"), "Amministrazione": sessionStorage.getItem("Amministrazione") },



GK Gunasekar Kuppusamy Syncfusion Team July 21, 2021 09:15 AM UTC

Hi Marco, 

We are glad that you have resolved the issue on your end by using AJAXPlease let us know if you need further assistance.
  
Regards,  
Gunasekar


Loader.
Up arrow icon