【问题标题】:how to localize button tooltips in jqgrid advanced search dialog如何在 jqgrid 高级搜索对话框中本地化按钮工具提示
【发布时间】:2012-04-08 08:21:02
【问题描述】:

似乎工具提示Add subgroupAdd ruleDelete rule 在 jqgrid 代码中是硬编码的。

            inputAddSubgroup = $("<input type='button' value='+ {}' title='Add subgroup' class='add-group'/>");

如何本地化它们?

【问题讨论】:

    标签: javascript jqgrid


    【解决方案1】:

    我在 trirand 上发布了我的详细 suggestion,并在稍后两次提醒 Tony 这个问题。

    另外,我在the answer 中描述了一种允许自定义高级搜索对话框的解决方法

    对原demo进行简单修改,如下new demo

    我使用了以下代码

    $.extend($.jgrid.search, {
        multipleSearch: true,
        multipleGroup: true,
        recreateFilter: true,
        closeOnEscape: true,
        closeAfterSearch: true,
        overlay: 0,
        afterRedraw: function () {
            $('input.add-rule',this).button().val('Add new rule')
                .attr('title', 'My Add new rule tooltip');
            $('input.add-group',this).button().val('Add new group or rules')
                .attr('title', 'My new group or rules tooltip');
            $('input.delete-rule',this).button().val('Delete rule')
                .attr('title', 'My Delete rule tooltip');
            $('input.delete-group',this).button().val('Delete group')
                .attr('title', 'My Delete group tooltip');
            $(this).find("table.group:not(:first)").css({
                borderWidth: "1px",
                borderStyle: "dashed"
            });
        }
    });
    

    我在组中添加了额外的边框,因为我觉得那里很有帮助。

    【讨论】:

    • 非常感谢。如果搜索对话框包含可能的行,则底部行和搜索按钮不可见。在这种情况下如何强制出现垂直滚动条?在我的应用程序中,边界没有围绕输入绘制,并在高级搜索对话框中选择元素。我在 css 文件中没有看到任何边框禁用。什么可能导致这个和 aow 启用边框?
    • 如果在搜索对话框中添加了很多行,会自动出现垂直滚动条。但是,如果打开高级搜索对话框,则不会出现滚动条,也无法访问底部规则和按钮。
    【解决方案2】:

    你可以再次使用 jquery,例如:$('select the button').attr('title', 'New localized title')

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-05-20
      • 1970-01-01
      • 1970-01-01
      • 2023-03-29
      • 1970-01-01
      • 2011-08-03
      • 2012-03-11
      • 1970-01-01
      相关资源
      最近更新 更多