functionClockgo () {Ext.TaskManager.start ({run:function () { //ext.getcmp ("clock"). SetText (Ext.Date.format (New Date (), ' g:i:s A ')); varShowtime = document.getElementById ("Time"); varnow =NewDate (); varDate = Now.tolocalestring ();////Get date and time such as June 25, 2014 afternoon 4:45:06 varHours =now.gethours (); varminutes =now.getminutes (); varseconds =now.getseconds (); if(Hours <) hours = "0" +hours; if(minutes <) minutes = "0" +minutes; if(seconds <) seconds = "0" +seconds; //var timestr = hours + ":" + minutes + ":" + seconds; varTimestr =date; Showtime.innerhtml=Timestr; }, Interval:1000//Refresh one time per second });}//Top PanelvarNorth =NewExt.panel ({frame:true, Plain:true, Height:56, border:false, Region:' North ', items: [{basecls:' X-plain ', border:false, Height:56, HTML:"<table cellspacing=0 cellpadding=0 width=100% background= '/images/header_bg.jpg ' border=0> <TR height=56 ><TD width=260></td><td style= ' Font-weight:bold; COLOR: #fff; padding-top:20px ' align=right> current time: <span id=time></span> </div> Current User: admin <a style= ' COLOR: #fff ' href= ' > Change Password </A> <a style= ' COLOR: #fff ' onclick= ' if (' Confirm ' OK to exit? ')) return true; else return false; ' href= ' target=_top> exit system </A> </td><td align=right width=268></td></tr></table><table cellSpacing=0 cellpadding=0 width=100% border=0><tr bgcolor= #1c5db6 height=4><td></td></tr></table > "}], listeners: {' Render ':function() {Clockgo (); } }});
EXTJS4.2 Time Dynamic Refresh display