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

Grid Save event is not fired

3 Answers 747 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Sanjay
Top achievements
Rank 1
Sanjay asked on 16 Jul 2014, 02:13 AM
Hi,

My grid definition is as below

@(Html.Kendo().Grid(Model).Name("RegionAprv")
                                .TableHtmlAttributes(new { style = "table-layout: fixed; width:245px;" })       
                                .DataSource(dataSource => dataSource.Ajax()                                           
                                                                    .Model(model => model.Field(p => p.RegionUid).DefaultValue(0))
                                                                    .Model(model => model.Id(p => p.RegionUid)) 
                                                                    .Batch(false)
                                                                    .Read(read => read.Action("GridRead", "MyControl").Data("<js method>"))  
                                                                    .Create(create => create.Action("GridInsert", "MyControl").Data("<js method>"))
                                                                    .Update(update => update.Action("GridUpdate", "MyControl").Data("<js method>"))
                                                                    .Events(events => events.RequestEnd("<js method>")
                                                                                            .Error("<js method>")
                                                                                            )                                           )
                                .Columns(columns => {
                                    ....       
                                })
                                .EnableCustomBinding(false)
                                .Selectable()
                                .Editable(editing => editing.Mode(Kendo.Mvc.UI.GridEditMode.InLine))
                                .Events(events => events.DataBound("onGridDataBound")
                                                        .Save("onGridSave")
                                                        .Edit("onGridEdit")
                                                        .Change("onGridChange")
                                       )
                )


JQuery file

 onGridSave: function (e) {
                  ...
                },

On Save I am calling grid.saveRow(). It should exeute the onGridSave but it is not doing so. I once the breakpoint is on grid.saveRow() step over just does nothing.

Please help

Regards,
Sanjay   

3 Answers, 1 is accepted

Sort by
0
Vladimir Iliev
Telerik team
answered on 17 Jul 2014, 09:12 AM
Hi Sanjay,

I tried to reproduce the problem locally but to no avail – everything is working as expected on our side. Could you please check the demo below and let me know how it differs from your real setup? This would help us pinpoint the exact reason for this behavior.

Regards,
Vladimir Iliev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
0
Sanjay
Top achievements
Rank 1
answered on 21 Jul 2014, 01:27 AM
Hi,

There are some differences with the demo. Like I have defined a model id and fields. I have used templates. So I can't make to one to one comparison.
Please let me know anything else you want to know about my code.

Regards,
Sanjay
0
Vladimir Iliev
Telerik team
answered on 21 Jul 2014, 07:46 AM
Hi Sanjay,

From this point I could only suggest to make sure you are not calling the "grid.saveRow()" method from the "Save" event handler of the Grid as this would cause infinite loop. If this is not the case please provide runable example where the issue is reproduced in order to investigate further current behavior.

Regards,
Vladimir Iliev
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
Sanjay
Top achievements
Rank 1
Answers by
Vladimir Iliev
Telerik team
Sanjay
Top achievements
Rank 1
Share this question
or