更改dojo dijit的文本

Change the text of dojo dijit

本文关键字:文本 dijit dojo 更改      更新时间:2023-09-26

几天来,我一直在寻找并尝试更改这个dijit文本,但似乎什么都不起作用。我想将dijit的初始显示从"打印"更改为"导出"。我已经尝试过使用jquery来调用dijit并更改文本。我也试过。

dojo.byId("print_button").innerHTML="EXPORT";dijit.byId("print_button").attr("export")

至少还有一些其他的东西,但我无法将最初的单词从打印改为导出。非常感谢您的帮助!

("

        //creates the templates and the dijit
    function handlePrintInfo(resp) {
        var templates;
        templates = [{
            label: "Image",
            format: "png32", //PNG format only
            layout: "MAP_ONLY",
            exportOptions: {width:1920, height:1182, dpi:200},
            showAttribution: false
            }];
        //create  the print dijit
        app.printer = new esri.dijit.Print
        ({
          "map": map,
          "templates": templates,                          
          url: app.printUrl                           
        }, dojo.byId("print_button"));
        app.printer.startup();
        app.printer._printText = "";
        app.printer._printingText = "Exporting";
        app.printer._printoutText = "Open Image";            
    } //end handleprintinfo

在调用esri.dijit.Print构造函数之后,但在调用app.prinker.startup()之前,执行以下操作:

app.printer._printText = "EXPORT";

至少对于3.6版本的ArcGIS API JavaScript来说,这就起到了作用。我不知道你用的是哪个版本,但试试看。

附言:我没有找到这方面的文件。萤火虫是我的朋友。:-)

您尝试过更改按钮的标签吗?

dijit.byId('print_button').set('label', 'Export')?