eduardosuruagy Posted November 1, 2020 Share Posted November 1, 2020 I have an error when creating a TUniDateTimePicker at runtime, it lets me enter a date 11/1/2020123456789 I'm creating it this way: cDateTimePicker: = TUniDateTimePicker.Create (sbox); cDateTimePicker.Parent: = sbox; cDateTimePicker.TabStop: = True; cDateTimePicker.Name: = 'A' + formatfloat ('000', QryParametros1IFP_SEQ_PARAMETRO.asInteger); cDateTimePicker.Top: = TopTotal - 5; cDateTimePicker.Height: = Height; cDateTimePicker.Width: = SmallerWidth; cDateTimePicker.TabOrder: = _viOrder; cDateTimePicker.Font.Size: = Source; cDateTimePicker.ClearButton: = True; cDateTimePicker.Enabled: = (QryParametros1IFP_INATIVO.AsString <> 'S'); cDateTimePicker.ClientEvents.UniEvents.Add ( 'beforeInit = function beforeInit (sender, config)' # 13 # 10 '{' # 13 # 10 '// disable' + 'ar the tip that always' # 233 'shown when hovering over the' + 'ta)' # 13 # 10 'config.formatText =' # 39 # 39 ';' # 13 # 10 # 13 # 10 '// SET THE CORRECT DATE QUAND' + 'O TYPE WITHOUT O /' # 13 # 10 'config.altFormats = "dmY | d / m / Y | n / j / Y | n / j / y | m /' + 'j / y | n / d / y | m / j / Y | n / d / Y | dmy | dmY | d / m | dm | dm | dmy | dmY |' # 65279'd | Ymd | n- ' + 'j | n / j ";' # 13 # 10 '}'); Gravar_2020_11_01_10_34_51_469.mp4 Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 2, 2020 Share Posted November 2, 2020 11 hours ago, eduardosuruagy said: I have an error when creating a TUniDateTimePicker at runtime, it lets me enter a date 11/1/2020123456789 Please make a simple testcase to check. Quote Link to comment Share on other sites More sharing options...
eduardosuruagy Posted November 3, 2020 Author Share Posted November 3, 2020 On 01/11/2020 at 22:38, Sherzod said: Faça um caso de teste simples para verificar. Attached is the test Nova pasta.rar Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 3, 2020 Share Posted November 3, 2020 14 minutes ago, eduardosuruagy said: Nova pasta.rar 4.15 MB · 0 downloads I will test your testcase. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 3, 2020 Share Posted November 3, 2020 1 hour ago, eduardosuruagy said: Nova pasta.rar 4.15 MB · 1 download Sorry, I initially did not pay attention to your question. You need an input mask. Quote Link to comment Share on other sites More sharing options...
eduardosuruagy Posted November 3, 2020 Author Share Posted November 3, 2020 28 minutes ago, Sherzod said: Lamento, inicialmente não prestei atenção à sua pergunta. Você precisa de uma máscara de entrada. If you look at the video you will notice that the component accepts to enter an invalid date, accepts to enter it 03/11/2020123456789 See the year as it is. This only happens if the component is created at run time. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 3, 2020 Share Posted November 3, 2020 1 minute ago, eduardosuruagy said: If you look at the video you will notice that the component accepts to enter an invalid date, accepts to enter it 03/11/2020123456789 Yes I see. I did not pay attention to what you said "accepts". 3 minutes ago, eduardosuruagy said: This only happens if the component is created at run time. I do not think so. It seems to me that this is normal behavior and it is by default. 34 minutes ago, Sherzod said: You need an input mask. I will analyze and let you know. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 3, 2020 Share Posted November 3, 2020 "With Ext JS 6.5 the inputMask has arrived. This is currently only available in the Modern toolkit for now but Classic will catch up soon." https://docs.sencha.com/extjs/6.5.0/guides/whats_new/whats_new.html#whats_new-_-whats_new_-_input_masking But seems this config does not work correctly for Classic. Quote Link to comment Share on other sites More sharing options...
eduardosuruagy Posted November 3, 2020 Author Share Posted November 3, 2020 50 minutes ago, Sherzod said: "Com Ext JS 6.5, chegou o inputMask. No momento, ele só está disponível no kit de ferramentas Modern, mas o Classic o alcançará em breve." https://docs.sencha.com/extjs/6.5.0/guides/whats_new/whats_new.html#whats_new-_-whats_new_-_input_masking Mas parece que esta configuração não funciona corretamente para o Classic. The theme I'm using is triton.modified Quote Link to comment Share on other sites More sharing options...
eduardosuruagy Posted December 3, 2020 Author Share Posted December 3, 2020 On 03/11/2020 at 12:13, Sherzod said: "Com Ext JS 6.5, chegou o inputMask. No momento, ele só está disponível no kit de ferramentas Modern, mas o Classic o alcançará em breve." https://docs.sencha.com/extjs/6.5.0/guides/whats_new/whats_new.html#whats_new-_-whats_new_-_input_masking Mas parece que esta configuração não funciona corretamente para o Classic. Boa tarde, consegue ver alguma coisa sobre isso? 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.