Adding dojo widget inside custom widget

前端 未结 2 2050
孤独总比滥情好
孤独总比滥情好 2020-12-18 11:42

I am making a small dojo widget, basically extending the dailog widget and want to add simple widgets like a text input a few labels etc. How do i go about this? I am follow

2条回答
  •  清歌不尽
    2020-12-18 12:13

    First. I'am not good at english, but will do at my best.

    This is the path of my widget.

    enter image description here

    Here. The important code in the js file that must declare.

    dojo.provide("gissoft.dijit.widgetOam"); 
    
    dojo.require("dojo.parser");
    dojo.require("dijit._Widget");
    dojo.require("dijit._Templated");
    
    dojo.declare("gissoft.dijit.widgetOam", [dijit._Widget, dijit._Templated], {
        widgetsInTemplate: true,
        basePath: dojo.moduleUrl("gissoft.dijit"),
        templatePath: dojo.moduleUrl("gissoft.dijit", "templates/widgetOam.html"),
    
        constructor: function () {
    
        },
    
        postMixInProperties: function () { 
    
        },
    
        postCreate: function () {
    
        },
    
        startup: function () {
    
        }
    
    });
    

    And in file widgetOam.html(templatePath)

    Hello World.

    And this is how to call widget from my Default.aspx

    You must add this before you call the dojo library

    
    

    And in the body

    
        

提交回复
热议问题