how to localize button tooltips in jqgrid advanced search dialog

前端 未结 2 558
野趣味
野趣味 2020-12-20 05:08

It seems like tooltips Add subgroup, Add rule, Delete rule are hard coded in jqgrid code.

            inputAddSubgroup         


        
相关标签:
2条回答
  • 2020-12-20 05:34

    I posted to trirand my detailed suggestion and reminded Tony twice about the problem later.

    Additionally I described in the answer a workaround which allows to customize the Advanced searching dialog

    enter image description here

    Simple modification of the original demo make the following new demo

    enter image description here

    I used the following code

    $.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"
            });
        }
    });
    

    I added additional border in groups because I find there helpful.

    0 讨论(0)
  • 2020-12-20 05:34

    You could use jquery again, for example: $('select the button').attr('title', 'New localized title')

    0 讨论(0)
提交回复
热议问题