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

Change Event Fired Multiple Times

1 Answer 282 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Tim
Top achievements
Rank 1
Tim asked on 01 Oct 2013, 10:37 PM
Hi, we have a grid that uses the Change event to go to a new screen, but the Change event is fired multiple times. Is this as expected or a bug?  
In the example below, the "Change" dialog is shown twice in Chrome and 3 times in FF.

@(Html.Kendo().Grid<VorDNAModel.SimpleModel.SimpleMixture>()
                        .Name("grid")
                        .Columns(columns =>
                        {
columns.Bound(p => p.MixtureId).Filterable(false).Title("Identification").Width(100);
                            columns.Bound(p => p.ReferenceNumber).Title("Reference #").Width(100);
columns.Bound(p => p.CaseName).Title("Case").Width(100);
columns.Bound(p => p.Description).Title("Description").Width(100);
columns.Bound(p => p.CollectionLocation).Title("Collection Location").Width(100);
columns.Bound(p => p.CollectedOn).Format("{0:MM/dd/yyyy}").Title("Collection Date").Width(100);
columns.Bound(p => p.LabAnalysisDate).Format("{0:MM/dd/yyyy}").Title("Lab Analysis Date").Width(100);
                        })
                        .Pageable()
                        .Sortable()
                        .Scrollable()
                        .Filterable()
                        .Selectable(selectable => selectable.Mode(GridSelectionMode.Single))
                        .Events(events => events.Change("onRowSelectionChanged"))
                        .HtmlAttributes(new { style = "height:740px;" })
                        .DataSource(dataSource => dataSource
                            .Ajax()
                            .PageSize(20)
                            .Read(read => read.Action("ListMixtures", "Mixture"))
                        )
                    )

function onRowSelectionChanged(arg) {
    alert("Change!");
}

1 Answer, 1 is accepted

Sort by
0
Dimiter Madjarov
Telerik team
answered on 02 Oct 2013, 08:42 AM
Hello Tim,


I would suggest you to use a console.log statement instead of alert in order to test events, since the result may be misleading otherwise. With this said, I was unable to reproduce the issue on my side. The event is fired once as expected.

Nevertheless if you are still experiencing any issues, please send me a sample project where the problem is reproducing, so I could assist you further.

I wish you a great day!

Regards,
Dimiter Madjarov
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
Tim
Top achievements
Rank 1
Answers by
Dimiter Madjarov
Telerik team
Share this question
or