我想在ext页面上动态显示当前时间,但是显示是显示了,没有动态刷新,代码是这样的,不知道问题在哪儿?
var clock = new Date().format('Y-m-d G:i:s A')+' '+aWeek[new Date().getDay()]; //定期更新时间
Ext.TaskMgr.start({
run: function(){
Ext.fly(clock).update(new Date().format('Y-m-d G:i:s A')+' '+aWeek[new Date().getDay()]);
},
interval: 1000
});
var clock = new Date().format('Y-m-d G:i:s A')+' '+aWeek[new Date().getDay()]; //定期更新时间
Ext.TaskMgr.start({
run: function(){
Ext.fly(clock).update(new Date().format('Y-m-d G:i:s A')+' '+aWeek[new Date().getDay()]);
},
interval: 1000
});
Ext.getCmp('datetime').setText(new Date().format('Y-m-d G:i:s A')+' '+aWeek[new Date().getDay()]);'datetime'是用显示时间的组件的id