Kendo Grid过滤器在引导模式中不起作用

时间:2015-07-13 14:42:59

标签: asp.net-mvc razor kendo-ui kendo-grid

我在前一天被问到这个问题,现在我完全无法解决这个问题。

Kendo UI grid filters not working inside a bootstrap Modal

我的模态设置如下:

<div class="modal fade" id="gapModalDiv" role="dialog" aria-labelledby="myModalLabel" data-backdrop="static">
<div class="modal-dialog custom-class" role="document">  
<div class="modal-content text-center">
  <div id="gapFocusDiv">
    <div class="modal-header">
      <h4 class="modal-title" id="myModalLabel">Eligible Person - </h4>
    </div>
    <div class="modal-body">
      @(Html.Kendo().Grid(Model)
            .Name("grid")
            .ToolBar(tools => tools.Excel())
            .Excel(excel => excel
                .AllPages(true)
                .FileName("Test.xlsx")
            )
            .Columns(columns =>
            {
                columns.Bound(p => p.Code).Title("Code").Width(150);
                columns.Bound(p => p.Name).Title("Name").Width(100);
                columns.Bound(p => p.RI).Title("RI").Width(70);
            })
            .Pageable()
            .Sortable()
            .Filterable()
            .Scrollable(scr => scr.Height(430))
            .DataSource(dataSource => dataSource
               .Ajax()
               .ServerOperation(false)
               .PageSize(20)
           )
      )
    </div>
    <br />

    <div class="modal-footer">
      <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
    </div>
  </div>
</div>

非常感谢任何帮助。 感谢。

1 个答案:

答案 0 :(得分:0)

我面临着同样的问题。事实证明,当我们在kendo尝试绘制网格时,将宽度分配给每列时,计算出的宽度与模型的总宽度不匹配。因此,要解决此问题,请在要调整大小的列上添加宽度,然后让网格自动计算剩余的列宽。

希望这可以帮助面临相同问题的任何人。

columns.Bound(p => p.Code).Title("Code").Width(50);
            columns.Bound(p => p.Name).Title("Name");
            columns.Bound(p => p.RI).Title("RI").Width(50);
相关问题