Jump to content

Recommended Posts

Posted

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.

Posted

Hi,

 

1) Try: 

 

UniDBLookupComboBox1 - > ClientEvents -> UniEvents -> add function beforeInit

function beforeInit(sender, config)
{
  sender.plugins = ['clearbutton'];
}

...

 

Best regards.

Posted

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.

Posted

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

Posted

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?

Posted

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).

Posted

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.

Posted

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 !

  • Administrators
Posted

 

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!

Posted

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

Posted

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

Posted

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.

Posted

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.

Posted

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

  • 5 years later...
Posted
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?

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...