Hello,
I have been using syncfusion grid and i really like your product and your technical support. I am having a problem with batchEidt mode and i am hoping that you will solve it as you always do.
The thing is i need to add new record from jquery ( Note that i am not pressing the grid control add button) without loosing the old data in the gird in batchEdit mode.
I tried to use the gridobj.addRecord(json ) and it adds a new row in the grid but then it directly calls the batchSave() method and i don't want the obj.addRecord() method to call batchSave() method instead i want to call the batchSave() method manually after performing add ,delete and edit operation to save all the grid data together in the saver.
can you please tell me how to add multiple records from jquery to grid in batchEditMode without loosing the existing grid data and save them together in the server.
You can see my grid code below -
@(Html.EJ().Grid<object>("HRZGrid")
.Datasource(ds => ds.URL(Url.Action("DataSource", "Transaction", null, Request.Url.Scheme)).BatchURL(Url.Action("Update", "Transaction", null, Request.Url.Scheme)).Adaptor(AdaptorType.UrlAdaptor))
.EnableAltRow()
.IsResponsive()
.AllowSorting()
.CssClass("hrz-grid")
.Locale("en-GB")
.GridLines(GridLines.Horizontal)
.EditSettings(edit => edit.AllowAdding().AllowDeleting().AllowEditing().EditMode(EditMode.Batch))
.PageSettings(page =>
{
page.PageSize(5);
})
.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);
items.AddTool(ToolBarItems.Search);
});
})
.AllowTextWrap()
.AllowResizeToFit()
.EnableHeaderHover()
.AllowPaging()
.ClientSideEvents(eve =>
{
eve.ActionComplete("onComplete");
eve.ActionFailure("onFailure");
eve.Create("onCreate");
eve.ActionBegin("onBeginAction");
eve.CellEdit("onCellEdit");
eve.CellSave("onCellSave");
eve.BatchDelete("onBatchDelete");
})
.Columns(col =>
{
col.Field("id").Visible(false).IsPrimaryKey(true).Add();
col.Field("No").HeaderText("NO.").AllowEditing(false).TextAlign(TextAlign.Left).Width(70).Add();
col.Field("code").HeaderText("Code").TextAlign(TextAlign.Left).Width(70).Add();
col.Field("description").HeaderText("Description").Width(90).TextAlign(TextAlign.Left).Add();
})
)
Regards ,
sachin