我有一个对话框,其名称如下
var dlg = new dijit.Dialog({
'title': 'my title',
'content': '<iframe style=\'width: 100%;\' id=\'myId\' src=\'' + mySource \' frameborder=\'0\' scrolling=\'no\'></iframe>',
'id': 'myId',
'style': 'width:420px; overflow:hidden',
'parseOnLoad' : true,
'autofocus': true
});
var actionBar = dojo.create('div', {
'class': 'footerClass'},
dlg.containerNode);
var confirm = new dijit.form.Button({
'label': 'ok',
'baseClass': 'button'
}).placeAt(actionBar);
var cancel = new dijit.form.Button({
'label': 'Cancel',
'baseClass': 'button'
}).placeAt(actionBar);
是否可以连接到ok按钮并执行onClick但是调用连接之外的函数,即:
dojo.connect(ok, 'onClick', null, dojo.hitch(ok, function() {
//Do some stuff....
//now call my other function which is outside this connect
myFunction()
})
function myFunction() {
//do some stuff
}
提前致谢