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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

RemoteSaveAdapter with ejGrid not working on Insert

Thread ID:

Created:

Updated:

Platform:

Replies:

142534 Feb 7,2019 09:38 PM UTC Feb 8,2019 06:04 AM UTC JavaScript 2
loading
Tags: ejGrid
Damien Turnbull
Asked On February 7, 2019 09:38 PM UTC

Hi

I have an ejGrid whose source has been set to a DataManager and using the remoteSaveAdapter.

When inserting a new record, the Grid seems to lose the record. My MVC controller Insert action returns all records from the database. Even when I change this to only return the record inserted the Grid still loses the record.

What am I doing wrong?

$(function () {
        $("#Grid").ejGrid({
          dataSource: ej.DataManager({
            json: Data, 
            updateUrl: projectionPage.urlFor("STAND0101/Update"), 
            insertUrl: projectionPage.urlFor("STAND0101/Insert"),
            removeUrl: projectionPage.urlFor("STAND0101/Delete"),
            adaptor: "remoteSaveAdaptor"        
          }),
          allowPaging: false,
          enableAltRow: false,
          allowSorting: true,
         ...


public ActionResult Insert(Model value)
    {
     
        var busEnt = DataServices.BusinessEntities.Save(value);
       
        return Json(FetchBusinessEntities(), JsonRequestBehavior.AllowGet);
          

      return Json(response);
    }

Damien Turnbull
Replied On February 7, 2019 10:02 PM UTC

Wait! I just got it working.

I just realised I didn't have a column marked as a primaryKey. As soon as I added that and then changed the controller action to return just the inserted record it worked.

Vignesh Natarajan [Syncfusion]
Replied On February 8, 2019 06:04 AM UTC

Hi Damien, 

Thanks for using Syncfusion products.  

We are glad to hear that your query has been resolved.  

Refer our UG and KB (knowledge base) document for the importance of PrimaryKey while Editing. 



Please get back to us if you have further queries. 

Regards, 
Vignesh Natarajan 


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

;