【问题标题】:Make Arrow symbol to plus(+) and minus(-) in Kendo Tree view在剑道树视图中将箭头符号设为加号(+)和减号(-)
【发布时间】:2014-10-27 11:39:21
【问题描述】:

我是 Kendo-UI 的新手,下面是我在 kendo 树视图中显示数据的示例代码。结果很好,但是在展开和折叠菜单时显示箭头符号,而不是我想将其设为加号(+)和减号(-):

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>Kendo UI Snippet</title>

    <link rel="stylesheet" href="http://cdn.kendostatic.com/2014.2.716/styles/kendo.common.min.css">
    <link rel="stylesheet" href="http://cdn.kendostatic.com/2014.2.716/styles/kendo.rtl.min.css">
    <link rel="stylesheet" href="http://cdn.kendostatic.com/2014.2.716/styles/kendo.default.min.css">
    <link rel="stylesheet" href="http://cdn.kendostatic.com/2014.2.716/styles/kendo.dataviz.min.css">
    <link rel="stylesheet" href="http://cdn.kendostatic.com/2014.2.716/styles/kendo.dataviz.default.min.css">
    <link rel="stylesheet" href="http://cdn.kendostatic.com/2014.2.716/styles/kendo.mobile.all.min.css">

    <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
    <script src="http://cdn.kendostatic.com/2014.2.716/js/kendo.all.min.js"></script>
</head>
<body>

<div id="treeview"></div>
<script>
$("#treeview").kendoTreeView({
  animation: false,
  dataSource: [
    { text: "foo", items: [
      { text: "bar", items: [{text:"car"}] }
    ] }
  ]
});
</script>
</body>
</html>

【问题讨论】:

    标签: javascript jquery css kendo-ui kendo-treeview


    【解决方案1】:

    您应该可以通过 css 自定义树形视图图标:

    .k-treeview .k-minus {
         background: url('../Images/your_minus_img.png')center center;
    }
    .k-treeview .k-plus{
         background: url('../Images/your_plus_img.png')center center;
    } 
    

    查看实时示例here on Dojo

    【讨论】:

    • 谢谢@Andrea,但它给出“无法加载给定的 url”,因为它取自“cdn.kendostatic.com/2014.2.716/styles”而不是我的路径
    • @majji 添加了指向道场现场示例的链接
    猜你喜欢
    • 2020-10-31
    • 2022-11-08
    • 2013-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多