【问题标题】:How to add line-break/new line in kendo ui custom toolbar如何在 kendo ui 自定义工具栏中添加换行符/换行符
【发布时间】:2014-10-20 21:58:25
【问题描述】:
@(Html.Kendo().Grid<ModelVM>()
.Name("ModelVM")
.HtmlAttributes(new { style = "padding: 0px; margin: 0px;height:100% "     })
.ToolBar(toolbar =>
{
    toolbar.Custom()
        .Text("First").HtmlAttributes(new { id = "someid" })
        .Action("Index2", "Home");
    toolbar.Custom()
        .Text("Second")
        .Action("Index2", "Home");
    toolbar.Custom()
        .Text("Third")
        .Action("Index3", "Home");
    toolbar.Custom()
        .Text("Fourth")
        .Action("Index4", "Home");
    toolbar.Custom()
        .Text("Fifth")
        .Action("Index5", "Home");
    toolbar.Custom()
        .Text("Sixth")
        .Action("Index6", "Home");
    .
    .
    .       
} )

我对简单的问题感到震惊。对不起,如果它太简单了。 我的问题是我希望“第六个”自定义工具栏应该进入新行。怎么做? 或 如何在 Kendo-UI 工具栏中插入换行符/换行符。提前致谢。

【问题讨论】:

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


    【解决方案1】:

    您可以通过使用 HTML 标记执行类似的操作并应用您想要的任何样式。

    .ToolBar(toolbar =>
    {
        toolbar.Template(@<text>
            <div class="toolbar">
                <a href="Index">Index</a> <p>
                <a href="Index2">Index2</a> <p>
                <a href="Index3">Index3</a> <p>
                ...
            </div>
        </text>);
    })
    

    【讨论】:

    • 如果我在第五个元素之后添加此代码。 toolbar.Template(@

      );整个工具栏消失。除了我在
      中添加的任何内容。你能在这里多放点光吗?无论如何感谢您的帮助。
    • 我的问题是如何使用toolbar.Template 来解决我提出的问题。如果我在以前的代码中使用toolbar.template。以前的代码不起作用。
    • @SushilGupta,不,您不要在第五个元素之后添加它,而是用它替换您拥有的东西,并在 text 标签之间放置您想要的任何东西:您的操作链接,例如。我会尽快编辑我的答案
    • 还没试过。但似乎它会起作用。谢谢。
    猜你喜欢
    • 2018-07-19
    • 1970-01-01
    • 2011-03-21
    • 2021-07-18
    • 2021-01-28
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多