Jump to content

TunimDBNumberEdit text (field) alignment


Wicket

Recommended Posts

Hi Guys,

 

I am having an issue with text alignment of TunimDBNumberEdit, its seems no matter the property I change it always appears right aligned, even when alignment is set to left.

I am using client side alignment and vbox on the form, and the fieldset contains the controls.

 

Below are two images, one of TunimDBEdit (which is aligned as I would expect) then TunimDBNumberEdit which is not.

 

Image Link to explain,

 

https://www.dropbox.com/s/ax4ewhm93b51oyy/text_alignment_issue.png?dl=0

 

 

Thanks

 

*Edit*

 

I am just trying to achieve a a list of fields which all work and align fine, apart from the TunimDBNumberEdit control. Am I missing something?

Link to comment
Share on other sites

  • 4 months later...

Rather than opening a new thread I will ask here as the problem is related. The above code works perfectly for controls created at design time.

However, I now need to create controls at runtime - and the alignment for the TUnimDbNumberEdit label is now incorrect, as per the image.

 

What do I need to do to make the label alignment as other controls, as per the image.

 

FYI - I am using touch 4.2, and build 1425 - I am hoping to upgrade to latest build ASAP, but for now I am stuck on this build, as I am just finishing the project.

 

https://www.dropbox.com/s/rojhmz3cwny5l80/label_alignment.png?dl=0

 

Thanks, Dan.

Link to comment
Share on other sites

I iterate a dataset to create any items, this is the reason why I create at runtime, as I do not know how many items are needed at design time.

I do not give the component a name

 

Here is the code I use, which creates all items as I want, just the label alignment can not be changed of TUnimDbNumberEdit.

 

   number := TUnimDbNumberEdit.Create(FrmMain);
   //alignment
    number.ClientEvents.UniEvents.Values['beforeInit']:= 'function beforeInit(sender, config) {config.style = {''text-align'':''left''}';
    number.Parent := fieldSet;
    number.DataSource := dsList;
    number.DataField := _FieldName;
    number.FieldLabel := _Caption;
    number.FieldLabelWidth := 40;

I will try giving the component a name and report back.

Link to comment
Share on other sites

OK, Once adding a name to the component I get 'Ajax Error' 'Unexpected Token' - which I guess means my JS is incorrect?

number.ClientEvents.UniEvents.Values['beforeInit']:= 'function beforeInit(sender, config) {config.style = {''text-align'':''left''}';

Can you confirm this is correct - perhaps the it does not like the double quoted string for {''text-align'':''left''} ?

Link to comment
Share on other sites

×
×
  • Create New...