Jump to content

Need Solutions


Point

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 !

Link to comment
Share on other sites

  • Administrators

 

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!

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...