简体   繁体   English

Kendo Grid垂直滚动条不仅显示为水平

[英]Kendo Grid vertical scrollbar doesn't appear only horizontal

I use Kendo Grid scrolling, as every other grids in my project. 我使用Kendo Grid滚动,就像我项目中的其他所有网格一样。 I have this grid, where horizontal scrolling works, but vertical doesn't appear. 我有这个网格,水平滚动工作,但不会出现垂直。

I've tried to set height of grid in HtmlAttributes setted height in .Scrollable() and added Enable in it. 我试图在.Scrollable()中设置HtmlAttributes设置高度的网格高度,并在其中添加了Enable。

@(Html.MaskableGrid<Elozmeny>("gridElozmenyek")
                    .Columns(columns =>
                    {
                        columns.Command(commands =>
                        {
                            commands.Edit().Text("<span></span>").UpdateText("<span></span>").CancelText("<span></span>").HtmlAttributes(KendoHelper.EditHtmlAttributesFor(Model)).Visible("isEditable");
                            commands.Destroy().Text("<span></span>").Visible("buttonVisible");
                        }).Width(Constants.DEFAULT_GRID_COLUMN_WIDTH_NARROWER).Title("")
                        .HtmlAttributes(KendoHelper.DestroyHtmlAttributesFor(Model));
                        columns.Bound(m => m.ElozmenyId).Width(Constants.DEFAULT_GRID_COLUMN_WIDTH).Title("Előzmény azonosító").ClientTemplate("#= ElozmenyId == 0 ? ' ' : ElozmenyId #");
                        columns.Bound(m => m.EsemenyTipusKod).ClientTemplate("#= EsemenyTipus != null ? EsemenyTipus.Nev : EsemenyTipusKod #").EditorTemplateName("EsemenyTipusDropDownEditor").EditorViewData(new { EsemenyTipus = "#=EsemenyTipusKod#" }).Width(Constants.DEFAULT_GRID_COLUMN_WIDTH).Title("Esemény típus");
                        columns.Bound(m => m.Leiras).EditorTemplateName("LeirasInputEditor").Encoded(false).Width(Constants.DEFAULT_GRID_COLUMN_WIDTH_WIDER).Title("Leírás");
                        columns.Bound(m => m.Megjegyzes).EditorTemplateName("MegjegyzesInputEditor").Encoded(false).Width(Constants.DEFAULT_GRID_COLUMN_WIDTH_WIDER).Title("Megjegyzés");
                        columns.Bound(m => m.EsemenyIdeje).Format("{0:yyyy.MM.dd}").EditorTemplateName("Date").Width(Constants.DEFAULT_GRID_COLUMN_WIDTH).Title("Esemény ideje");
                        columns.Bound(m => m.BejegyzoMunkatarsNev).ClientTemplate("#= BejegyzoMunkatars != null ? BejegyzoMunkatars.Nev : currUser() #").Width(Constants.DEFAULT_GRID_COLUMN_WIDTH).Title("Bejegyző munkatárs").Editable("isEditable");
                        columns.Bound(m => m.VersionNumber).Hidden(true);
                    }).Events(x => x.Save("saveLeirasEsMegjegyzes").Edit("OnEditGridElozmeny"))
                    .ToolBar(toolBar => toolBar.Create().Text("<span></span>").HtmlAttributes(new { @id = "addButton"}))
                    .DataSource(dataSource => dataSource.Ajax()
                        .Model(model =>
                        {
                            model.Id(m => m.ElozmenyId);
                            model.Field(m => m.EsemenyTipus).DefaultValue(new EsemenyTipus() { Kod = "EGYEB", Nev = "Egyéb" });
                            model.Field(m => m.Leiras).Editable(true);
                            model.Field(m => m.Megjegyzes).Editable(true);
                            model.Field(m => m.EsemenyTipusKod);
                            model.Field(m => m.EsemenyIdeje).Editable(true);
                            model.Field(m => m.BejegyzoMunkatars).DefaultValue(new Munkatars() { MunkatarsId = User.Identity.GetMunkatarsId().Value, Nev = User.Identity.Name }).Editable(false);
                            model.Field(m => m.BejegyzoMunkatarsId).DefaultValue(User.Identity.GetMunkatarsId().Value);
                            model.Field(m => m.Eid).DefaultValue(Model.Entity.Eid).Editable(false);
                        })
                        .Read(read => read.Action("SelectElozmeny", "Epulet", new { epuletId = Model.Entity.Eid }))
                        .Destroy("DeleteElozmeny", "Elozmeny")
                        .Update(update => update.Action("UpdateElozmeny", "Elozmeny"))
                        .Create("InsertElozmeny", "Elozmeny")
                        .Events(x => x.RequestEnd("elozmenyGridRequestEnding"))
                        .PageSize(10)
                        .Sort(sort => sort.Add(m => m.EsemenyIdeje).Descending())
                    )
                    .Filterable(KendoHelper.DefaultGridFilterConfig)
                    .Pageable(KendoHelper.DefaultPagerConfig)
                    .Sortable(sorter => { sorter.SortMode(GridSortMode.SingleColumn); sorter.AllowUnsort(false); })
                    .AutoBind(false)
                    .HtmlAttributes(new { style = "height: 600px" })
                    .Scrollable(s => { s.Enabled(true); s.Height(250); })
                )

I expect both scrollbars to appear and become usable. 我希望两个滚动条都出现并变得可用。

referring to Telerik forum telerik forum 指的是Telerik论坛telerik论坛

try to set up height to auto .Scrollable(s => s.Height("auto")) 尝试将高度设置为自动.Scrollable(s => s.Height("auto"))

also scrolling might depend on wrappers you have around this grid and their styling 滚动也可能取决于你在这个网格周围的包装和它们的样式

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM