- Home
- Forum
- ASP.NET MVC
- Datamanager keep editurl after executequery updates datasource (json)
Datamanager keep editurl after executequery updates datasource (json)
Since the batch edit functionality performs the CRUD operation as a whole; all the added, edited, deleted record details will be passed to the server as list of records. The InsertURL, UpdateURL and RemoveURL properties will not be triggered as on performing CRUD operations in grid it will be locally saved in grid and only on clicking the update icon in grid toolbar, a post action with all the batch changes will be triggered which is handled using BatchURL property.
The Server-Side function is declared with the following parameters for editing functionality.
Parameters Table
|
Action |
Parameter Name |
Example |
|
Batch Add |
added |
public ActionResult BatchUpdate(List<Orders> changed, List<Orders> added, List<Orders> deleted){} |
|
Batch Update |
changed | |
|
Batch Delete |
deleted |
Please refer to the below documentation for more information.
Attachment: EditMode_6e36ae4a.7z
I am using Syncfusion.EJ.MVC Version 15.2500.040 (Runtime Version v4.0.30319)
I am having effectively the same problem. I have a Grid where I allow Edit via a RemoteSaveAdapater as shown below:
@(Html.EJ().Grid<FLWeb.Models.Account>("FlatGrid")
.Datasource(ds => ds.Json((IEnumerable<object>)ViewBag.datasource).UpdateURL("/FL_Account/Update")
.InsertURL("/FL_Account/Insert").RemoveURL("/FL_Account/Remove").Adaptor(AdaptorType.RemoteSaveAdaptor))
.AllowSorting()
// .AllowPaging()
.EditSettings(edit => { edit.AllowAdding().AllowDeleting().AllowEditing().EditMode(EditMode.DialogTemplate).DialogEditorTemplateID("#template"); })
.ToolbarSettings(toolbar =>
{
toolbar.ShowToolbar().ToolbarItems(items =>
{
items.AddTool(ToolBarItems.Search);
//items.AddTool(ToolBarItems.Add);
//items.AddTool(ToolBarItems.Edit);
//items.AddTool(ToolBarItems.Delete);
//items.AddTool(ToolBarItems.Update);
//items.AddTool(ToolBarItems.Cancel);
});
})
.AllowPaging()
.PageSettings(page => page.PageSize(15))
.AllowSorting()
.AllowGrouping()
.AllowResizeToFit()
.AllowFiltering()
.FilterSettings(filter => { filter.FilterType(FilterType.Excel); })
// .AllowFiltering()
.IsResponsive(true)
// .EnableResponsiveRow(true)
.Columns(col =>
{
col.Field("ClientAcctID").IsPrimaryKey(true).Visible(false).Add();
col.Field("AccountName").Width(100).Add();
col.Field("GroupName").Width(100).Add();
col.Field("PrimaryPhone").Width(60).HeaderText("Phone").Add();
col.Field("OfficeType").Width(50).Add();
col.Field("AcctTeamName").Width(50).HeaderText("Team").Add();
col.Field("City").Width(100).Add();
col.Field("State").Width(30).Add();
col.Field("Zip").Width(40).Add();
col.Field("ActiveAcct").Width(30).Add();
}
)
The grid uses a Dialog Editor template where like Luis, it works somewhat reliabily on the first load of the view. In other words if I go to the View and I edit record #1, I can see the controller method being called, and data being handled on the server etc. However, if I attempt to edit the same record a second time, the controller action is never called. I likewise don't see any errors on the client (browser debugging tools), which leaves me with little I can troubleshoot.
Please advise!
- 5 Replies
- 4 Participants
-
LJ Luis Javier Almazan Emery
- Jan 19, 2017 06:09 PM UTC
- Oct 2, 2017 05:35 AM UTC