【问题标题】:Toggle tooltip content(Kendo) using jquery使用 jquery 切换工具提示内容(剑道)
【发布时间】:2016-10-19 08:56:28
【问题描述】:

我为一个看起来像这样的按钮设置了剑道工具提示..

代码在这里

// JS
var labels = { tt_piechart_text: "Show Pie Chart", tt_piechart_hide: "Hide Pie Chart"  }
$("#pieChartBtn").kendoTooltip({
        position: "bottom"
    });
// HTML
<input id="pieChartBtn" type="button" class="pieChartBtn" title="{{tt_piechart_text}}">

这很好,直到我想在单击或激活按钮时将工具提示的内容更改为“隐藏饼图”。这是我正在尝试的代码..

$('#pieChartBtn').click(function() {
    if ($(this).hasClass('active')) {
        $(this).removeClass('active');
        $("#pieChartBtn").data("kendoTooltip").popup.wrapper.find(".k-tooltip-content").html("{{tt_piechart_text}}");
    } else {
        $(this).addClass('active');
        $("#pieChartBtn").data("kendoTooltip").popup.wrapper.find(".k-tooltip-content").html("{{tt_piechart_hide}}");
    }
    $('#pieChartBtn').toggle();
});

代码部分实现了我想要的。现在唯一的问题是,{{tt_piechart_text}}{{tt_piechart_hide}} 被呈现为字符串。像这样..

我希望将表达式呈现为等效的字符串。我在这里想念什么?如何解决这个问题?我正在使用 Angular 1X 和 Kendo 工具提示。

【问题讨论】:

    标签: javascript jquery angularjs kendo-ui tooltip


    【解决方案1】:

    我相信您应该使用 k-content 属性并从控制器更新 html,如演示中所示http://demos.telerik.com/kendo-ui/tooltip/angular

    【讨论】:

      猜你喜欢
      • 2015-06-28
      • 1970-01-01
      • 2010-10-10
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多