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.

Grid does not send modified object to CrudURL

Thread ID:

Created:

Updated:

Platform:

Replies:

124108 May 17,2016 01:45 PM Jul 31,2017 09:27 AM ASP.NET MVC 3
loading
Tags: Grid
Soycake
Asked On May 17, 2016 01:45 PM

I create simple grid with CRUD operation and update database via CrudURL. When I click add item on toolbar and input data then Save, input value does not send through CrudController. 

[Razer]
@(Html.EJ().Grid<Computer>("FlatGrid")
    .Datasource(ds => ds.URL(@Url.Action("DataSource", "Inventory")).CrudURL(@Url.Action("CrudUpdate", "Inventory")).Adaptor(AdaptorType.UrlAdaptor))
    .AllowPaging()
    .AllowSelection()
    .EditSettings(edit =>
    {
        edit
            .AllowAdding()
            .AllowDeleting()
            .AllowEditing()
            .EditMode(EditMode.DialogTemplate).DialogEditorTemplateID("#template");
    })
    .ToolbarSettings(toolbar =>
    {
        toolbar.ShowToolbar().ToolbarItems(items =>
        {
            items.AddTool(ToolBarItems.Add);
            items.AddTool(ToolBarItems.Edit);
            items.AddTool(ToolBarItems.Delete);
            items.AddTool(ToolBarItems.Update);
            items.AddTool(ToolBarItems.Cancel);
        });
    })
    ...

[Controller]
        public ActionResult CrudUpdate(Computer computer, string action)          <----- property of computer has null value and ID = 0 but I have selected another ID to edit.
        {
            switch (action)
            {
                case "insert":
                  ...
                case "update":
                  ...
                case "delete":
                  ...


Do you have any suggestion about this case or Sample CRUD project that work with database?

Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On May 18, 2016 02:09 AM

Hi Soycake, 
  
We are able reproduce the problem with your code example.  

The first parameter of your CrudUpdate() must be value and so you can get the values POST from the client-side. But in your code example, you have used computer. Refer to the following code example and screenshot and make necessary changes in your project. 

@(Html.EJ().Grid<object>("Editing") 
           .Datasource(ds => ds.URL("/Home/Data").CrudURL("/Home/CrudUpdate").Adaptor(AdaptorType.UrlAdaptor)) 
           .AllowPaging() 
            . . . 
              . . .  
) 
 
        public ActionResult CrudUpdate(EditableOrder value, string action) { 
            return Json(value, JsonRequestBehavior.AllowGet); 
        } 


 

We have prepared a sample that can be downloaded from the following location. 


Refer to the following Help Document for CRUD action. 


Regards, 
Seeni Sakthi Kumar S. 


Anass Rhmoun
Replied On July 28, 2017 02:14 AM

Dear Seeni,

Kindly if could be provide complete example CRUD, as I'm not able to see how Remove operation is working when we're using CrudURL.

Regards,



Seeni Sakthi Kumar Seeni Raj [Syncfusion]
Replied On July 31, 2017 09:27 AM

Hi Anass,  
 
We have modified the sample that can be downloaded from the following location.  
 
 
If you are still facing any problem, please share the following information. 
 
  1. Code example of the Grid and server.
  2. Version of the Essential Studio
 
Regards,  
Seeni Sakthi Kumar 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.

;