剑道ui工具提示在网格中的定位问题

Positioning issue with kendo ui tooltip inside a grid

本文关键字:定位 问题 网格 ui 工具提示 剑道      更新时间:2024-06-07

我在网格单元中的kendoui工具提示有问题。在网格中,我显示了一个简单的文档文件夹。每行列出一个文件。在第一列中,我有一个小的预览图标和图像或文件的下载链接。如果我悬停在图像上,就会调用工具提示。

示例:

<a class="documents has_preview" href="<my_download_path>" title="<my_image_title>" data-url="<my_preview_image_path>">
<span class="icon preview_image image jpg has_image">
    <img src="<my_preview_icon_path>" border="0" alt="" />
</span>
<my_image_name>

插入的工具提示如下:

<script id="template" type="text/x-kendo-template">
    <img src="#=target.data('url')#" alt="#=target.data('title')#" />
    <p>#=target.data('title')#</p>
</script>
$("#grid").kendoTooltip({
    filter: "a.has_preview",
    content: kendo.template($("#template").html()),
    position: "top"
});

问题是:

如果我第一次悬停图像名称,工具提示将不会显示在指定的位置。第二次悬停相同的图像名称时,所有内容都会正确显示。。。

有人能给我一个提示吗?

非常感谢!Philip

我们可以通过将位置设置为"left"来修复它。