Ajax之后的Bootstrap工具提示丢失样式

时间:2016-01-23 18:03:39

标签: jquery ajax tooltip

所以我有一个每行都有一个图标的表,如果你将鼠标悬停在图标上,则会出现一个引导工具提示。但是一旦我做了一个HTML ajax调用来返回一个新表,工具提示就会失去它们的风格。

我尝试使用

重新初始化ajax成功的工具

$( '[数据肘节= “提示”]')工具提示();

但是我收到以下错误消息

未捕获TypeError:$(...)。tooltip不是函数

我真的很难解决这个问题

        $.ajax({
        url: "/Controller/Action",
        type: "POST",
        dataType: "html",
        data: { 'gtr': gt, 'lower': lower, 'count': 10 },
        success: function (data) {
            $('#customtable').empty();
            $('#customtable').html(data);
            var customtable = $('#games').dataTable({
                "bLengthChange": false,
                "bPaginate": false,
                "bFilter": false,
                "bInfo": false,
                "columnDefs": [{ "targets": 1, "orderable": false }, { "targets": 0, "orderable": false }, { "targets": 4, "orderable": false, "width": "7%" }],
            });
            customtable.fnSort([[0, 'dsc']]);
            $('[data-toggle="tooltip"]').tooltip();
        },
        error: function () {
                alert("Something went wrong there");
            }
    });

然后是表中的关注列

                                        <td><img src="@n.GameVariantIcon" class="player-gamevariant" data-toggle="tooltip" title="@n.GamerVariantName" data-placement="right" /></td>

0 个答案:

没有答案
相关问题