perissf
perissf

Reputation: 16273

Cannot access programmatically to dijit.Dialog

I cannot find the way to access progammatically to a dijit.Dialog. The following code:

<!DOCTYPE HTML>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>Dialog</title>
        <script src="http://ajax.googleapis.com/ajax/libs/dojo/1.6.0/dojo/dojo.xd.js"></script>
        <script type="text/javascript">
            dojo.require("dijit.Dialog");
            dojo.addOnLoad(function() {
                var myDialog = dojo.byId("myDialog");
                myDialog.attr("content", "My New Content")
            })
        </script>
    </head>
    <body class="claro">
        <div id="myDialog" dojoType="dijit.Dialog" title="My Dialog">
        </div>
    </body>
</html>

causes the following error: "myDialog.attr is not a function". The same happens if I use "set" method instead of "attr".

Upvotes: 1

Views: 285

Answers (1)

perissf
perissf

Reputation: 16273

Solved! instead of using dojo.byId I should have used dijit.byId !

Upvotes: 1

Related Questions