Ario.Paxaz Posted June 3, 2017 Share Posted June 3, 2017 Hi Farshad I write a test case for add separator in uniedit,when user fill it with number. And I use same issue for UniDbEdit too. Best Regards. UniEdit_SeperatorOnEdit.rar Quote Link to comment Share on other sites More sharing options...
Ario.Paxaz Posted June 3, 2017 Author Share Posted June 3, 2017 Hi My Friend give me below code function change(sender, newValue, oldValue, eOpts) { var separator = ","; var int = sender.value.replace ( new RegExp ( separator, "g" ), "" ); var regexp = new RegExp ( "\\B(\\d{3})(" + separator + "|$)" ); do { int = int.replace ( regexp, separator + "$1" ); } while ( int.search ( regexp ) >= 0 ) sender.setValue(int); } and i put it in ClientEvent.ExtEvent.change.and it done very faster than my issue. But when add it to my code by dynamic ,it don't work. Where it must be add ? Best Regards. Quote Link to comment Share on other sites More sharing options...
Abaksoft Posted June 3, 2017 Share Posted June 3, 2017 Hello Soltani, Each unigui component has a special property named : clientEvents > ExtEvents (On the left side of your Delphi Ide : properties windows). Copy and paste your fuction in this special property, onChange event. Regards Quote Link to comment Share on other sites More sharing options...
Ario.Paxaz Posted June 4, 2017 Author Share Posted June 4, 2017 Hi clientEvents > ExtEvents I copy it ,and work very good. But my question is : when i want use it dynamic,Which event must be use ? As you see in my pic ,I use it in onchange of uniedit,but it don't work. Best regards. Quote Link to comment Share on other sites More sharing options...
Abaksoft Posted June 4, 2017 Share Posted June 4, 2017 OK, Dynamically, the syntaxe is : UniEdit1.ClientEvent.ExtEvents.Values['change']:= ..... But you are right works only onCreate Form event !? maybe this can help : http://forums.unigui.com/index.php?/topic/6575-clientevents-and-runtime-component-creation-help-me/&do=findComment&comment=33438 All the best Quote Link to comment Share on other sites More sharing options...
Ario.Paxaz Posted June 4, 2017 Author Share Posted June 4, 2017 Dynamically, the syntaxe is : UniEdit1.ClientEvent.ExtEvents.Values['change']:= Thanks .It's Worked. But you are right works only onCreate Form event !? No,Its Sample Only Best Regards. 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.