Jump to content

Remove Clear button TunimDBNumberEdit and TuniDBFormattedNumberEdit


chrisjohn82
 Share

Recommended Posts

Hi everybody,
I wonder if it's possible to remove the clear button on the TuniDBNumberEdit and TuniDBFormattedNumberEdit. I could not find properties for this. I am using the controls in the web form and mobile form. The button will show as i start typing and in the textbox.

 

Best regards

Christian  

Link to comment
Share on other sites

I tried in both controls and it did not work on the web control(did not get an error message but the "x" still shows and works) but i can't get it to work on the mobile either because i already have code for the color code and if i try the code below i get an error that says "unexpected identifier 'sender'" and onEnter and onExit i have the following code below. If i remove the code in beforeinit and comment out the code in onExit and onEnter it works but i want both.

 

Code for the mobile control 

 

function beforeInit(sender, config)
{
   config.clearIcon = false
   
   sender.setFieldStyle = function (a){
        var b=this,
        c=Ext.get(b.element.select('.x-input-el').elements[0].id);
        if©{c.applyStyles(a)}b.element.fieldStyle=a
    } 
}
 
OnExit for the numbercontrol  (if i comment this code out, i get the clearbutton to disappear)
 
procedure Tform5.edantalettExit(Sender: TObject);
begin
   if not edantalett.ReadOnly then begin
       (Sender as TUnimDBNumberEdit).Color := clWhite
   end;
end;
 
OnEnter for the numbercontrol  (if i comment this code out, i get the clearbutton to disappear)
 
procedure Tform5.edantalettEnter(Sender: TObject);
begin
   if not edantalett.ReadOnly then begin
       (Sender as TUnimDBNumberEdit).Color := clYellow
   end;
end;
 
Link to comment
Share on other sites

  • 4 years later...

 

Edit controls have property "ClearButton" by it seems does not works.

If True or False ... clear button is always visible. 

In help is written for this propery It defines if the control has a Clear button to erase all its content.

 

In application there is cases where it should not be possible for user to clear edit value.

How to do that ?

Link to comment
Share on other sites

2 hours ago, kkelchev said:

In application there is cases where it should not be possible for user to clear edit value.

ReadOnly = True ?

2 hours ago, kkelchev said:

Edit controls have property "ClearButton" by it seems does not works.

If True or False ... clear button is always visible. 

Can you make a simple testcase to see the issue?

Link to comment
Share on other sites

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.

 Share

×
×
  • Create New...