PDA

View Full Version : display hours in my header of the application



senda
27 May 2009, 8:20 AM
hi everyone,
I am still novice with extjs,
then I want to insert a clock in my web application in the header of my page
how can I do,
is it a type of field or what??
it is urgent
sorry for my bad language
thinks

tryanDLS
27 May 2009, 8:39 AM
Moved - please post in correct forum.

You mean you want to display the current time, not have the user enter a time? No there is not functionality like that - you might try searching the exensions forum.

koko2589
27 May 2009, 9:46 AM
you can put clock in tbar

new Ext.Toolbar({
buttons: ['->', '', ''],
afterRender: function() {
Ext.Toolbar.prototype.afterRender.apply(this, arguments);
var timeEl = this.items.get(this.items.getCount() - 1).getEl();
var dateEl = this.items.get(this.items.getCount() - 2).getEl();

Ext.TaskMgr.start({
run: function() {
var d = new Date();
timeEl.innerHTML = d.format('G:i:s');
dateEl.innerHTML = d.format('m/d/Y');
},
interval: 1000
});

senda
28 May 2009, 1:34 AM
thank you for your help,
but the problem that I have no TBARS in my header, I have a header in html, I do not know if you understand me or not, because I put your code in the tag <script> </ script> and it is not displayed