Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
474 views
in Technique[技术] by (71.8m points)

javascript - how to localize button tooltips in jqgrid advanced search dialog

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

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

How to localize them?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...