Sherzod Posted April 5 Share Posted April 5 Let's add TrayClock to UniStatusBar (can be added to other controls). 1. initialization UniAddCSSLibrary('build/packages/ux/classic/classic/resources/ux-all.css', False, [upoFolderJS, upoPlatformDesktop]); UniAddJSLibrary('build/packages/ux/classic/ux.js', False, [upoFolderJS, upoPlatformDesktop]); 2. UniStatusBar.ClientEvents.ExtEvents -> function afterrender(sender, eOpts) { if (Ext.isDefined(Ext.ux)) { sender.add({ xtype: 'tbfill' }); sender.add( new Ext.ux.desktop.TrayClock() ); } } Let's modify by adding a style, a time format, and an update time of one second. (2). function afterrender(sender, eOpts) { if (Ext.isDefined(Ext.ux)) { sender.add({ xtype: 'tbfill' }); sender.add(new Ext.ux.desktop.TrayClock({ tpl: '<span style="color: green; font-weight: bold;">{time}</span>', //default = '{time}' timeFormat: 'Y-m-d H:i:s', //default = 'g:i A' updateTime: function() { var me = this, time = Ext.Date.format(new Date(), me.timeFormat), text = me.tpl.apply({ time: time }); if (me.lastText !== text) { me.setText(text); me.lastText = text; } me.timer = Ext.defer(me.updateTime, 1000, me); } })); } } 1 1 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 5 Author Share Posted April 5 https://docs.sencha.com/extjs/7.5.1/classic/Ext.ux.desktop.TrayClock.html https://docs.sencha.com/extjs/7.5.1/classic/Ext.Date.html Quote Link to comment Share on other sites More sharing options...
picyka Posted April 5 Share Posted April 5 It would be possible to create a timer on the client side, which would need a play and a stop, and still take this time on the server side. I once tried to do this on the client side and was unsuccessful. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 5 Author Share Posted April 5 Hello, Please explain in more detail. Quote Link to comment Share on other sites More sharing options...
picyka Posted April 5 Share Posted April 5 I would like when starting a registration to show a time counter, and when saving the registration, I can save this time, I did it using UniTimer, but it keeps talking to the server all the time Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 5 Author Share Posted April 5 12 minutes ago, picyka said: to show a time counter How to understand this, sorry? Quote Link to comment Share on other sites More sharing options...
picyka Posted April 5 Share Posted April 5 Há 42 minutos, Sherzod disse: Como entender isso, desculpe? 00:06 - Cronômetro online - RelogioOnline.com.br Quote Link to comment Share on other sites More sharing options...
picyka Posted April 5 Share Posted April 5 I needed a clock that would show how many minutes the person has been in the register, but the timer should only update on the client side. When saving, I could stop the timer and get the time value. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 5 Author Share Posted April 5 Ok. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 9 Author Share Posted April 9 On 4/5/2024 at 9:53 PM, picyka said: I needed a clock that would show how many minutes the person has been in the register, but the timer should only update on the client side. When saving, I could stop the timer and get the time value. Hello, I will give you an example. 1 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted April 10 Author Share Posted April 10 On 4/5/2024 at 9:53 PM, picyka said: Are you showing a regular login form? Quote Link to comment Share on other sites More sharing options...
picyka Posted April 10 Share Posted April 10 I did not understand your question. Quote Link to comment Share on other sites More sharing options...
picyka Posted April 10 Share Posted April 10 To access the screens you need to login Quote Link to comment Share on other sites More sharing options...
picyka Posted April 11 Share Posted April 11 With the help of master @Sherzod I managed it, here is an example Stay here, thank you very much. TestTimer.zip 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.