Premature updates on wijmo using virtual scrolling

12 Views Asked by At

Platform: .NET mvc, c1 flexgrid using virtual scrolling. Situation 1: User starts to edit cells in one of the rows in the flexgrid. As long as focus stays on same row no updates are made. When focus shifts to another row, updates are sent to server.

Situation 2: User scrolls to a portion that enforces update of grid. Edit cells in one of the row now causes an update for every time a cell has been editet, even if focus is shifted to another cell in the same row.

The grid is defined as follows:

        @(Html.C1().FlexGrid<SWPP.Models.ITEM_ViewItem>()

                    .Id("itemsGrid")
                    .Bind(
                        bl => bl.InitialItemsCount(100)
                                .Bind(Url.Action(Model.ControllerReadMethodName))
                                .Update(Url.Action(Model.ControllerUpdateMethodName))
                                .Delete(Url.Action(Model.ControllerDeleteMethodName))
                                .Create(Url.Action(Model.ControllerCreateMethodName))
                    )
                    .AutoClipboard(true)
                    .AutoGenerateColumns(false)
                    .KeyActionTab(KeyAction.CycleEditable)
                    .KeyActionEnter(KeyAction.None)
                    .IsReadOnly(isReadOnly)
                    .AutoSearch(false)
                    .CaseSensitiveSearch(false)
                    .CssClass("grid")
                    .AutoRowHeights(false)
                    .AllowAddNew(canAddNewRow)
                    .AllowDelete(true)
                    .NewRowAtTop(false)
                    .SelectionMode(C1.Web.Mvc.Grid.SelectionMode.RowRange)
                    .Columns(b =>
                    {
                        b.Add(cb => cb.Binding("ProjectID").Visible(false));
                        b.Add(cb => cb.Binding("UniqueNo").Visible(false));
                        foreach (var h in Model.Headers)
                        {
                            if (h.InputSpec.Type == ShipWeightPlussMVC.Models.InputSpec.InputTypes.Edit)
                            {
                                b.Add(cb => cb
                                .Binding(h.FieldName)
                                .Header(h.Caption)
                                .Align(h.TextAlign) // #240210-25
                                .DataType(h.DataType)
                                .IsReadOnly(h.ReadOnly)
                                .Format(h.Format)

                                );
                            }
                            else
                            {
                                b.Add(cb => cb
                                .Binding(h.FieldName)
                                .DataMapEditor(DataMapEditor.DropDownList) // #240207-01, #240210-13
                                .DataMap(dm => dm
                                    .DisplayMemberPath("Key") // #240210-16
                                    .SelectedValuePath("Key")
                                    .SortByDisplayValues(true)
                                    .IsEditable(h.InputSpec.Type == ShipWeightPlussMVC.Models.InputSpec.InputTypes.ComboBox) // #240207-01
                                    .Bind(h.InputSpec.EditItems)
                                    )
                                .Header(h.Caption)
                                .Align(h.TextAlign) // #240210-25
                                .DataType(h.DataType)
                                .IsReadOnly(h.ReadOnly)
                                .Format(h.Format)
                                );
                            }
                        }

                    })
        )

After scrolling, the grid suddenly starts to send row changes after every cell edit.

0

There are 0 best solutions below