Call dijit.Dialog from method?

Hi, I have an action that runs a JavaScript method. In the method, I have the following code:
new dijit.Dialog({title: "apa", style: "width: 800px"});
When running it, dijit.Dialog isn't found, so it returns an exception. How do I load dijit in the context of a method?
Parents
  • Hi, I currently work on a similar use case. I want to open a tooltip dialog from the grid. For a regular dialog, something like this basically works from a Javascript Method:
    require([
        "dijit/Dialog", 
        "dijit/form/Form", 
        "dijit/form/TextBox", 
        "dijit/form/Button", 
        "dojo/domReady!" 
    ], function(Dialog, Form, TextBox, Button) 
    {
        var form = new Form();
    
        new TextBox({
            placeHolder: "Name"
        }).placeAt(form.containerNode);
    
        new Button({
          label: "OK"
        }).placeAt(form.containerNode);
    
        var dialog = new Dialog({
            content: form,
            title: "Dialog with form content",
            style: "width: 300px; height: 300px;"
        });
        form.startup();
        dialog.show();
    });
Reply
  • Hi, I currently work on a similar use case. I want to open a tooltip dialog from the grid. For a regular dialog, something like this basically works from a Javascript Method:
    require([
        "dijit/Dialog", 
        "dijit/form/Form", 
        "dijit/form/TextBox", 
        "dijit/form/Button", 
        "dojo/domReady!" 
    ], function(Dialog, Form, TextBox, Button) 
    {
        var form = new Form();
    
        new TextBox({
            placeHolder: "Name"
        }).placeAt(form.containerNode);
    
        new Button({
          label: "OK"
        }).placeAt(form.containerNode);
    
        var dialog = new Dialog({
            content: form,
            title: "Dialog with form content",
            style: "width: 300px; height: 300px;"
        });
        form.startup();
        dialog.show();
    });
Children
No Data