zl程序教程

您现在的位置是:首页 >  其他

当前栏目

在网格底部放置Kendo工具栏

2023-04-18 12:50:20 时间

我有一个带有工具栏的Kendo网格,如何将它放置在网格后面。在网格底部放置Kendo工具栏

我已经做了一个快速搜索,发现堆栈中有this,但我的命令栏仍显示在网格上方。

我不知道这里出了什么问题,谁能请我指出正确的方向? 代码:

<div id="divDependentDetails" > 
    @if (Model.IsDependentGridEnabled) 
    { 
@(Html.Kendo().Grid(Model.DependentDetailsList) 
      .Name("DependentGrid") 
      .Events(e => e.SaveChanges("DependentGridSave") 

      ) 
        .Columns(columns => 
        { 
         columns.ForeignKey(p => p.TitleCode, Model.TitleList, "TitleCode", "TitleDescription").Title("Title"); 
         columns.Bound(p => p.FirstName).Title("First Name"); 
         columns.Bound(p => p.MiddleName).Title("Middle Name"); 
         columns.Bound(p => p.LastName).Title("Last Name"); ; 
         columns.ForeignKey(p => p.Gender, Model.GenderList, "TitleCode", "TitleDescription").Title("Gender"); 
         columns.ForeignKey(p => p.RelationShipCode, Model.RelationShipList, "RelationShipCode", "RelationShipName").Title("Relationship"); 
         columns.Bound(p => p.DepDOB).Format("{0:dd-MMM-yyyy}").Title("Date of Birth"); 
         columns.Bound(p => p.RelationShipStartDate).Format("{0:dd-MMM-yyyy}").Title("Relationship Start Date"); 
         columns.Bound(p => p.RelationShipEndDate).Format("{0:dd-MMM-yyyy}").Title("Relationship End Date"); 
         columns.Bound(p => p.EmailAddress).Title("Email"); 
         columns.Bound(p => p.DepPassportNumber).Title("Passport Number"); 
         columns.Bound(p => p.DepPassportExpDate).Format("{0:dd-MMM-yyyy}").Title("Passport Expiry"); 
         columns.Command(command => command.Destroy()); 
        }) 

        .ToolBar(toolBar => 
        { 
         toolBar.Create().Text("Add"); 
         toolBar.Save().SaveText("Submit").CancelText("Reset"); 
        }) 
        .Editable(editable => editable.Mode(GridEditMode.InCell)) 

        .Sortable() 
        .Resizable(resize => resize.Columns(true)) 
        .Filterable() 
        .DataSource(dataSource => dataSource 
         .Ajax() 
         .Batch(true) 
         .ServerOperation(false) 
         .Model(model => 
         { 
          model.Id(m => m.DependantDetialId); 

         }) 
         .Update(update => update.Action("DependentDetails_Update", "EmployeeSelfService") 
       ) 
       .Create(create => create.Action("DependentDetails_Create", "EmployeeSelfService") 
     ) 
       .Destroy(delete => delete.Action("DependentDetails_Destroy", "EmployeeSelfService") 
      ) 
       .Events(e => e.RequestEnd("DependentGrid_onComplete") 
       ) 
        ) 
        ) 

    } 
</div> 
<script> 
    $("#DependentGrid").find(".k-grid-toolbar").insertAfter($("#DependentGrid .k-grid-content")); 
</script> 

karthick

kendo ui论坛是一个更好的地方问这个问题。 –

@MohammandSepahvand谢谢,我的公司有许可证的剑道,但我还没有链接到..所以我无法张贴在剑道形式。 –

回答

我知道了......探索呈现的HTML我发现,没有“.K-格的内容”在里面,只有“.K网”,它能正常工作后。 ...

<script> 

// $("#DependentGrid").find(".k-grid-toolbar").insertAfter($("#DependentGrid .k-grid-content")); --- not working 

// Working Line 

$("#DependentGrid").find(".k-grid-toolbar").insertAfter($("#divDependentDetails .k-grid")); 
</script> 

在网格底部放置Kendo工具栏