dojo自定义小部件onshow事件howto

时间:2014-07-15 14:27:25

标签: dojo dijit.layout

关注我的自定义小部件代码。 一切都很好,除了事件" onShow"。

有没有办法添加活动" onShow"自定义小部件?

谢谢!

CLASS:

define(["dojo/_base/declare","dijit/_WidgetBase", "dijit/_TemplatedMixin", "dijit/_WidgetsInTemplateMixin"
,"dojo/text!./templates/testWidget2.html"
],
function(declare, _WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin
    ,template
){
return declare([_WidgetBase, _TemplatedMixin, _WidgetsInTemplateMixin ], {

    templateString: template,

    onShow: function() {
        console.info("testW2 onShow")
    }         

});
});

TEMPLATE:

<div class="${baseClass}" style="border:solid 1px green;">
<h1>W2</h1>
</div>

1 个答案:

答案 0 :(得分:0)

尝试使用:

this.inherited(arguments)

在postCreate和启动部分声明。

如:

startup: function(){
  trace("startup"); // helps you trace it in the console
  this.inherited(arguments);
}
相关问题