rtalmeida Posted March 14, 2019 Share Posted March 14, 2019 How do I change the font to bold when value is greater than zero, and remove the bold when the value is zero? this can not occur in onexit because the value can be changed by another routine. Example project attachment bold.zip Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 14, 2019 Share Posted March 14, 2019 Hi, Can you please open a ticket in support portal? At the moment you can try to use this approach I think (without "OnChange, OnChangeValue" on the server side): function beforeInit(sender, config) { var me=sender; config.listeners = { change: function(){ if (me.getValue()!=0) { me.inputEl.setStyle('font-weight', 'bold') } else { me.inputEl.setStyle('font-weight', '') } } }; } Quote Link to comment Share on other sites More sharing options...
rtalmeida Posted March 14, 2019 Author Share Posted March 14, 2019 With the solution shown, it's working, but if I try to enter a negative number, it returns the error: '' - 'is not a valid floating point value'. I'll try to open the ticket, I never opened any. Quote Link to comment Share on other sites More sharing options...
rtalmeida Posted March 14, 2019 Author Share Posted March 14, 2019 I need the effect to occur also, not only when typed a value in the field, but also when it is fed into the form's onAfterShow, in the example I sent it places onAfterShow UniFormattedNumberEdit1.value: = 10; Quote Link to comment Share on other sites More sharing options...
rtalmeida Posted March 15, 2019 Author Share Posted March 15, 2019 Sherzod, can you help me? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 16, 2019 Share Posted March 16, 2019 On 3/14/2019 at 6:41 PM, rtalmeida said: I need the effect to occur also, not only when typed a value in the field, but also when it is fed into the form's onAfterShow, in the example I sent it places onAfterShow UniFormattedNumberEdit1.value: = 10; Hi, Try this: function beforeInit(sender, config) { var me=sender; config.listeners = { change: function(){ if (me.getValue()!=0) { me.inputEl.setStyle('font-weight', 'bold') } else { me.inputEl.setStyle('font-weight', '') } }, dirtychange: function(){ if (me.getValue()!=0) { me.inputEl.setStyle('font-weight', 'bold') } else { me.inputEl.setStyle('font-weight', '') } } }; } Quote Link to comment Share on other sites More sharing options...
Tokay Posted March 16, 2019 Share Posted March 16, 2019 On 3/14/2019 at 4:32 PM, rtalmeida said: With the solution shown, it's working, but if I try to enter a negative number, it returns the error: '' - 'is not a valid floating point value'. I'll try to open the ticket, I never opened any. I think, that could happened cause of my ticket: http://jira.fmsoft.net/servicedesk/customer/portal/4/FSD-693 If you have sources you can try fix it: in uniEdit module change StrToFloat to StrToFloatDef: FValue := StrToFloat(S, FmtSettings); to FValue := StrToFloatDef(S, 0, FmtSettings); Farshad, please fix it, I submit the ticket and solution at August. Quote Link to comment Share on other sites More sharing options...
rtalmeida Posted March 16, 2019 Author Share Posted March 16, 2019 Very Good, Sherzod, very good, do you know everything about JS or do you have a mine map? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted March 16, 2019 Share Posted March 16, 2019 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.