起步软件技术论坛
搜索
 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1740|回复: 2

[结贴] messageDialog的callback怎么用?

[复制链接]

18

主题

80

帖子

180

积分

初级会员

Rank: 2

积分
180
QQ
发表于 2017-2-16 11:35:30 | 显示全部楼层 |阅读模式
callback是怎么用的?为什么这样写,在提示框还没有关闭的时候,就已经页面跳转了?我理解的不对吗?
me.comp("messageDialog").show({
"type" : "OK",
"message" : "用户注册成功!\n请加入团队",
"callback" : function(){                                                       
me.comp('windowDialog').open({
src : "$UI/fireJob/inTeam.w"
});
}
});

1

主题

6163

帖子

2095

积分

金牌会员

Rank: 6Rank: 6

积分
2095
QQ
发表于 2017-2-16 11:58:41 | 显示全部楼层
        Model.prototype.show = function(event) {
                Message.message("aler", "通过代码动态创建MessageDialog");
                if (!this.msg)
                        this.msg = new MsgDialog({
                                parentNode : this.getElementByXid("buttons")
                        });
                this.msg.on('onClose', function(event) {
                        this.comp('output').set({
                                'value' : '点击:' + event.button + ',input:' + event.input
                        });
                }, this);
                this.msg.show({
                        type : this.type,
                        title : this.title,
                        message : this.text,
                        inputValue : this.inputValue,
                        width : this.width
                });
        };

你再this.msg.on('onClose',这里写跳转  他就是关闭完再跳了
回复 支持 反对

使用道具 举报

18

主题

80

帖子

180

积分

初级会员

Rank: 2

积分
180
QQ
 楼主| 发表于 2017-2-16 12:18:41 | 显示全部楼层
半导体 发表于 2017-2-16 11:58
Model.prototype.show = function(event) {
                Message.message("aler", "通过代码动态创建MessageD ...

可以了,谢谢,结帖吧
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|X3技术论坛|Justep Inc.    

GMT+8, 2025-7-22 03:44 , Processed in 0.059686 second(s), 23 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表