jahlxx Posted January 17, 2017 Share Posted January 17, 2017 Hi. I need some uninumberedit get the value as 0, when they have emty text. I have trested with emptytext := '0', and minvalue := 0, but when the user "empty" the field, it doesn't take the value 0. is some vcl components, I have the property valueifempty. How can I solve this with unigui? Thanks. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 18, 2017 Share Posted January 18, 2017 Hi, Maybe, for now you need to use this approach ?!: UniNumberEdit -> ClientEvents -> ExtEvents -> blur fn: function blur(sender, e, eOpts) { var me=sender; if (Ext.isEmpty(me.value)) { me.setValue(0); } } Best regards. Quote Link to comment Share on other sites More sharing options...
jahlxx Posted January 18, 2017 Author Share Posted January 18, 2017 Ok. Perfect!!. Thanks. Quote Link to comment Share on other sites More sharing options...
jahlxx Posted July 5, 2018 Author Share Posted July 5, 2018 Hi again. Now, this don't work with extjs 6. Any idea? Thanks. Quote Link to comment Share on other sites More sharing options...
jahlxx Posted July 6, 2018 Author Share Posted July 6, 2018 hi. this is a very bis problem for me. where a user leaves a uninumberedit as blank, the returned value is -1 help please. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 6, 2018 Share Posted July 6, 2018 Hi, hi. this is a very bis problem for me. where a user leaves a uninumberedit as blank, the returned value is -1 help please. Can you try these events?: procedure TMainForm.UniNumberEdit1ChangeValue(Sender: TObject); begin if (Sender as TUniNumberEdit).Text = '' then (Sender as TUniNumberEdit).Value := 0; end; Or procedure TMainForm.UniNumberEdit1Change(Sender: TObject); begin if (Sender as TUniNumberEdit).Text = '' then (Sender as TUniNumberEdit).Value := 0; end; Quote Link to comment Share on other sites More sharing options...
jahlxx Posted July 6, 2018 Author Share Posted July 6, 2018 for every numberedit in every form? huge work. why don't work emptytext property? or perhaps I don't understand the meaning of that property. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted July 6, 2018 Share Posted July 6, 2018 Also you can try this: procedure TMainForm.UniFormCreate(Sender: TObject); begin UniNumberEdit1.JSInterface.JSAddListener('blur', 'function(me){if (Ext.isEmpty(me.value)) {me.setValue(0)}}'); end; Quote Link to comment Share on other sites More sharing options...
pro_imaj Posted December 19, 2022 Share Posted December 19, 2022 On 7/6/2018 at 1:24 PM, Sherzod said: Also you can try this: procedure TMainForm.UniFormCreate(Sender: TObject); begin UniNumberEdit1.JSInterface.JSAddListener('blur', 'function(me){if (Ext.isEmpty(me.value)) {me.setValue(0)}}'); end; @Sherzod I am sending you an example. When you delete all the values in the above component, you will see the value of -1. * If the onchange feature is -1, do not say 0, after all, the user can give a value of -1. test02.zip 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.