【问题标题】:Modify tool-tip of phpgrid dynamically动态修改phpgrid的tool-tip
【发布时间】:2015-05-18 08:04:04
【问题描述】:

我正在为我的网站使用来自www.phpgrid.com 的数据网格。我想将工具提示自定义为自定义内容。我应该修改哪个文件,我应该做什么?

我在他们的文档中看到了一个参考:

http://phpgrid.uservoice.com/knowledgebase/articles/33488-tool-tip-for-column-headers

但这对我不起作用。

【问题讨论】:

    标签: php phpgrid


    【解决方案1】:

    你想做什么?该代码非常不言自明。将“Column 1 header title”替换为第一个列标题,将“Column 2 header title”替换为第二个,依此类推。

    jQuery(document).ready(function($){
        jQuery("tr.ui-jqgrid-labels th:eq(0)").attr("title", "Column 1 header title");
        jQuery("tr.ui-jqgrid-labels th:eq(1)").attr("title", "Column 2 header title");
        jQuery("tr.ui-jqgrid-labels th:eq(2)").attr("title", "Column 3 header title");
    
    });
    

    【讨论】:

    • 我在网格数据单元格中有书名。当用户将鼠标悬停在它上面时,我希望他们在工具提示中看到该书的简短描述,而不是标题本身。
    • 这正是“title”属性的作用。你应该看看 w3school 教程w3schools.com/tags/att_global_title.asp。将鼠标悬停在文本上并等待大约 1 秒,以便出现工具提示。
    猜你喜欢
    • 2015-04-25
    • 2015-04-30
    • 2023-01-12
    • 2012-11-05
    • 1970-01-01
    • 2018-07-26
    • 2017-07-11
    • 2021-11-10
    • 2013-04-29
    相关资源
    最近更新 更多