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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

CRUD after refreshing datasource

Thread ID:

Created:

Updated:

Platform:

Replies:

151283 Feb 5,2020 09:53 PM UTC Feb 7,2020 12:22 PM UTC ASP.NET MVC 3
loading
Tags: Grid
Bernard Jurlina
Asked On February 5, 2020 09:53 PM UTC

Why the CRUD from the grid is not working after I set datasource from the code?
I will try to explain in the attached file.

Thanks.
Bernard.

Attachment: crud_d22aea8b.rar

Farveen Sulthana Thameeztheen Basha [Syncfusion]
Replied On February 6, 2020 03:19 PM UTC

Hi Bernard, 

Thanks for contacting Syncfusion Support. 
 
Query#:- Why the CRUD from the grid is not working after I set datasource from the code? 

We have checked your code example and we can reproduce the problem from your code. While on analyzing further you have updated the dataSource using dataSource method.  When we update using dataSource method, it will behaves like Local Data and we couldn’t perform CRUD operations on this.  

While using remoteSaveAdaptor, dataSource has been updated on model.dataSource.dataSource.json. So we suggest you to update the dataSource on model.dataSource.dataSource.json and refresh the Grid using refreshContent method 

Refer to the modified code example:- 

function onGodinaChange(args) { 
         var god = $("#cboxGodina").val(); 
         var obj = $("#gridPlan").data("ejGrid"); 
        var src = '@Url.Action("Data", "Grid", new { area = "" })'; 
        $.ajax({ 
            cache: false, 
            url: src, 
            data: { "Godina": god }, 
            type: "get" 
        }).done(function (data) { 
            obj.model.dataSource.dataSource.json = ej.parseJSON(Data); 
            obj.refreshContent(); 
             
        }).fail(function(xhr, status, error) { 
            var err = eval("(" + xhr.responseText + ")"); 
            alert("fail"); 
        }); 
    } 

Refer to the API Link:- 

Please get back to us if you need any further assistance. 

Regards, 
Farveen sulthana T 
  


Bernard Jurlina
Replied On February 6, 2020 08:53 PM UTC

Hi Farveen,

and thanks for the answer. Your solution is working perfect.

Regards!
Bernard.

Farveen Sulthana Thameeztheen Basha [Syncfusion]
Replied On February 7, 2020 12:22 PM UTC

Hi Bernard, 

Thanks for your update. Please get back to us if you need any further assistance. 

Regards, 
Farveen sulthana T  


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon