简体   繁体   English

更改dojo dijit的文本

[英]Change the text of dojo dijit

I've been looking and trying to change this dijit text for days now and nothing seems to working. 我一直在寻找并尝试更改这种dijit文本已有几天了,而且似乎没有任何效果。 I want to change the initial display of the dijit from "Print" to "Export". 我想将dijit的初始显示从“打印”更改为“导出”。 I've tried using jquery to call the dijit and change the text. 我尝试使用jquery来调用dijit并更改文本。 I've also tried. 我也尝试过

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

and least a few other things but I can not change the initial words from print to export. 至少还有其他几件事,但是我无法将初始单词从打印更改为导出。 Any help is GREATLY APPRECIATED! 任何帮助是极大的赞赏!

(" (“

        //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

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

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

After the call to the esri.dijit.Print constructor, but before the call to app.printer.startup(), do this: 在调用esri.dijit.Print构造函数之后,但调用app.printer.startup()之前,执行以下操作:

app.printer._printText = "EXPORT";

That does the trick, at least with version 3.6 of the ArcGIS API for JavaScript. 至少在使用ArcGIS API for JavaScript 3.6版时,就可以做到这一点。 I don't know which version you're using, but give it a try. 我不知道您使用的是哪个版本,请尝试一下。

PS I didn't find documentation on this. 附言:我没有找到有关此文档。 Firebug is my friend. Firebug是我的朋友。 :-) :-)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM