This is a migrated thread and some comments may be shown as answers.

Gird popup editing with deferred save

4 Answers 208 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Leslie
Top achievements
Rank 1
Leslie asked on 26 Mar 2013, 07:16 PM
I am currently investigating the Kendo UI.

Is it really true that you cannot edit a grid without a trip to the server for each add/update/delete with a popup editor?  I would like the grid to be part of a larger object and nothing gets saved until the entire object gets saved.  This seems like a very common scenario to me!  Am I missing something?

If I don't supply a Create action, I get a compile error.  If I set batch mode to true, and I leave off the Save command in the grid, it calls the create command when I add a row through a popup editor (and it calls the batch version of create passing multiple objects which is strange since the save should be deferred).  If I set batch mode to true and include the Save command, I get a runtime error:

"You must use InCell edit mode for batch updates"

How can I use a popup editor for the grid and post the entire form to save my changes at a later date while avoiding constant trips to the server?

Leslie

@(Html.Kendo().Grid(Model.item.vendoritems)
.Name("grdVendorItems")
.Columns(columns =>
{
columns.Bound(c => c.vendorid);
columns.Bound(c => c.vendoritemcode);
columns.Bound(c => c.name);
columns.Bound(c => c.description);
columns.Bound(c => c.uomclassid);
columns.ForeignKey(c => c.vendorid, Model.vendorList, "Value", "Text");
columns.Command(command => { command.Edit(); });
}
)
.ToolBar(toolbar => { toolbar.Create(); toolbar.Save(); })
.Editable(editable =>
{
editable.Mode(GridEditMode.PopUp);
editable.TemplateName("vendoritemEditor");
editable.AdditionalViewData(new { VendorList = Model.vendorList, UOMClassList = Model.uomClassList });
}
)
 .Sortable()
.Scrollable()
.DataSource(dataSource => dataSource
.Ajax()
.ServerOperation(false)
.Batch(true)
.Model(model =>
{
model.Id(i => i.id);
model.Field(i => i.id).Editable(false);
})
.Events(events => events.Error("error_handler"))
.Create(update => update.Action("EditingPopup_Create", "VendorItems"))
.Update(update => update.Action("EditKendo", "VendorItems"))
)
)

4 Answers, 1 is accepted

Sort by
0
Petur Subev
Telerik team
answered on 28 Mar 2013, 01:15 PM
Hello Leslie,

Such editing mode is not supported. 

You can try and use the similar work-around solution as the one covered here.

http://www.kendoui.com/code-library/mvc/grid/external-editing-container-for-batch-editable-grid.aspx

Kind Regards,
Petur Subev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Aaron
Top achievements
Rank 1
answered on 23 May 2014, 04:27 PM
I found a way to achieve this by listing to the grid save event and calling container.data( "kendoWindow" ).close()
0
Aaron
Top achievements
Rank 1
answered on 23 May 2014, 04:29 PM
I was mistaken.  I thought I had it working.
0
Petur Subev
Telerik team
answered on 27 May 2014, 07:15 AM
Hello Aaron ,

Could you please share more details about the issue that you have and clarify your question? 

Kind Regards,
Petur Subev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
Leslie
Top achievements
Rank 1
Answers by
Petur Subev
Telerik team
Aaron
Top achievements
Rank 1
Share this question
or