Point Posted January 13, 2015 Share Posted January 13, 2015 now i try to migrate application to unigui framework, but there are some cases that I face, may be somebody can help or give solutions, here are: 1. How to set null value key in dblookupcombobox, or is it possible to add clear button feature like uniedit component in dblookupcombobox to set null value? 2. in unidbgrid column dan dbuniedit with number type can fill with any character, how to avoid this. i want number only 3. Display format in field properties with type number, be ignored when set edit format. i found this case in unidbedit 4. setting display format (#,##0.##) in field properties with type number raise error when post; (cause edit format be ignored, when edit record, i have to throw thousand and decimal separator to avoid error). 5. setting Display format with long date ("dd MMMM yyyy") in datetime type and number type with display format (#,##0.##) in field properties not act when data was changed or exit bound control. for us, it's very important to ensure data operator when input data, is data inputed correct or not. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 13, 2015 Share Posted January 13, 2015 Hi, 1) Try: UniDBLookupComboBox1 - > ClientEvents -> UniEvents -> add function beforeInit function beforeInit(sender, config) { sender.plugins = ['clearbutton']; } ... Best regards. Quote Link to comment Share on other sites More sharing options...
Point Posted January 13, 2015 Author Share Posted January 13, 2015 hi delphi developer, Thanks you very much for solution number 1. and I also hope that you can provide a solution to case numbers 2,3,4 and 5. Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted January 13, 2015 Administrators Share Posted January 13, 2015 It is very hard to read your first post. Can you please re-format it better so we can easily see your question? Quote Link to comment Share on other sites More sharing options...
Point Posted January 13, 2015 Author Share Posted January 13, 2015 i try to reformat that paragraph but not work. essentially there are 5 cases that I face when I try to migrate my project to unigui framework Quote Link to comment Share on other sites More sharing options...
Point Posted January 13, 2015 Author Share Posted January 13, 2015 1. How to set null value key in dblookupcombobox, or is it possible to add clear button feature like uniedit component in dblookupcombobox to set null value? Quote Link to comment Share on other sites More sharing options...
Point Posted January 13, 2015 Author Share Posted January 13, 2015 2. in unidbgrid column dan dbuniedit with number type can fill with any character, how to avoid this. i want number only Quote Link to comment Share on other sites More sharing options...
Point Posted January 13, 2015 Author Share Posted January 13, 2015 3. Display format in field properties with type number, be ignored when set edit format. i found this case in unidbedit Quote Link to comment Share on other sites More sharing options...
Point Posted January 13, 2015 Author Share Posted January 13, 2015 4. setting display format (#,##0.##) in field properties with type number raise error when post; (cause edit format be ignored, when edit record, i have to throw thousand and decimal separator to avoid error). Quote Link to comment Share on other sites More sharing options...
Point Posted January 13, 2015 Author Share Posted January 13, 2015 5. setting Display format with long date ("dd MMMM yyyy") in datetime type and number type with display format (#,##0.##) in field properties not act when data was changed or exit bound control. for us, it's very important to ensure data operator when input data, is data inputed correct or not. Quote Link to comment Share on other sites More sharing options...
adragan Posted January 13, 2015 Share Posted January 13, 2015 1. Work around : Use UniDBComboBox. Initial Text property empty. At Form.Show event populate the Items with selectable values. 2. UniHiddenPanel with UniDBNumberEdit linked to whatever column you want. 3 + 4. UniDBGrid.WebOptions.DefaultFloatFormat :='#,##0.00' 5. With the Date format it's a mess. UniDateTimePicker behaves eratically when date format is other than 'mm/dd/yyyy' ( American ). A date like 01.00.2015 is what you can easily see with the 'dd.mm.yyyy' format. I hope it will be fixed some time. I hope I understood correctly your questions. It was not easy ! Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted January 13, 2015 Administrators Share Posted January 13, 2015 5. With the Date format it's a mess. UniDateTimePicker behaves eratically when date format is other than 'mm/dd/yyyy' ( American ). A date like 01.00.2015 is what you can easily see with the 'dd.mm.yyyy' format. I hope it will be fixed some time. Can you please send a report on this? This must have been fixed ages ago! Quote Link to comment Share on other sites More sharing options...
Point Posted January 13, 2015 Author Share Posted January 13, 2015 5. With the Date format it's a mess. UniDateTimePicker behaves eratically when date format is other than 'mm/dd/yyyy' ( American ). A date like 01.00.2015 is what you can easily see with the 'dd.mm.yyyy' format. I hope it will be fixed some time. i use display format in field properties to avoid this case. so i use unidbedit to display data with datetime type Quote Link to comment Share on other sites More sharing options...
Point Posted January 13, 2015 Author Share Posted January 13, 2015 Can you please send a report on this? This must have been fixed ages ago! UniDBDateTimePicker always show MM/DD/YYYY, whereas UniDBDateTimePicker has set to date format dd/MM/yyyy Quote Link to comment Share on other sites More sharing options...
Point Posted January 13, 2015 Author Share Posted January 13, 2015 1. Work around : Use UniDBComboBox. Initial Text property empty. At Form.Show event populate the Items with selectable values. 2. UniHiddenPanel with UniDBNumberEdit linked to whatever column you want. 3 + 4. UniDBGrid.WebOptions.DefaultFloatFormat :='#,##0.00' 5. With the Date format it's a mess. UniDateTimePicker behaves eratically when date format is other than 'mm/dd/yyyy' ( American ). A date like 01.00.2015 is what you can easily see with the 'dd.mm.yyyy' format. I hope it will be fixed some time. I hope I understood correctly your questions. It was not easy ! - cases No 1 has been solved on the advice of mr delphi developer. - UniDBNumberEdit does have display format properties. - i try to set unidbgrid with UniDBGrid.WebOptions.DefaultFloatFormat :='#,##0.00', not work, still be able to input some character. Quote Link to comment Share on other sites More sharing options...
Point Posted January 13, 2015 Author Share Posted January 13, 2015 for information i use :delphi xe3unigui 0.98.0.1127google chromefirefox Quote Link to comment Share on other sites More sharing options...
Sherzod Posted January 14, 2015 Share Posted January 14, 2015 Hi, 2) About dbuniedit before there were questions on the forum, you can search, for example, here is the solution to enter only numbers: One of the solutions: UniDBEdit1 > ClientEvents > ExtEvents > OnKeydown function keydown(sender, e, eOpts) { var event = e; if (event.keyCode == 46 || event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 27 || event.keyCode == 13 || (event.keyCode == 65 && event.ctrlKey === true) || (event.keyCode >= 35 && event.keyCode <= 39)) { return; } else { if (event.shiftKey || (event.keyCode < 48 || event.keyCode > 57) && (event.keyCode < 96 || event.keyCode > 105)) { event.preventDefault(); } } } or even easier: UniDBEdit1 > ClientEvents > UniEvents > beforeInit function beforeInit(sender, config) { sender.maskRe = /[0123456789]/; } Best regards. Quote Link to comment Share on other sites More sharing options...
Point Posted January 14, 2015 Author Share Posted January 14, 2015 hi delphi developer, I tried to make a component derived from TuniDbEdit to handle display format with data type of date and number, but still there are errors. i hope you can help me to fix the script. uniDBCstmEdit.rar Quote Link to comment Share on other sites More sharing options...
Administrators Farshad Mohajeri Posted January 17, 2015 Administrators Share Posted January 17, 2015 UniDBDateTimePicker always show MM/DD/YYYY, whereas UniDBDateTimePicker has set to date format dd/MM/yyyy I didn't understand this. You can change format from properties. Quote Link to comment Share on other sites More sharing options...
eduardosuruagy Posted June 1, 2020 Share Posted June 1, 2020 On 1/14/2015 at 4:39 AM, Sherzod said: Hi, 2) About dbuniedit before there were questions on the forum, you can search, for example, here is the solution to enter only numbers: One of the solutions: UniDBEdit1 > ClientEvents > ExtEvents > OnKeydown function keydown(sender, e, eOpts) { var event = e; if (event.keyCode == 46 || event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 27 || event.keyCode == 13 || (event.keyCode == 65 && event.ctrlKey === true) || (event.keyCode >= 35 && event.keyCode <= 39)) { return; } else { if (event.shiftKey || (event.keyCode < 48 || event.keyCode > 57) && (event.keyCode < 96 || event.keyCode > 105)) { event.preventDefault(); } } } or even easier: UniDBEdit1 > ClientEvents > UniEvents > beforeInit function beforeInit(sender, config) { sender.maskRe = /[0123456789]/; } Best regards. Good morning, I use this code in an edit to accept just numbers: UniDBEdit1> ClientEvents> UniEvents> beforeInit function beforeInit (sender, config) { sender.maskRe = / [0123456789] /; } I would like my edit to accept letters and numbers, how do I do it? Quote Link to comment Share on other sites More sharing options...
Sherzod Posted June 2, 2020 Share Posted June 2, 2020 15 hours ago, eduardosuruagy said: letters In English? Quote Link to comment Share on other sites More sharing options...
eduardosuruagy Posted June 2, 2020 Share Posted June 2, 2020 6 hours ago, Sherzod said: Em inglês? It would be number and characters 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.