简体   繁体   中英

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. I want to change the initial display of the dijit from "Print" to "Export". I've tried using jquery to call the dijit and change the text. I've also tried.

dojo.byId("print_button").innerHTML = "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:

app.printer._printText = "EXPORT";

That does the trick, at least with version 3.6 of the ArcGIS API for JavaScript. 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. :-)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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