Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: placing a space inside a label (  doesn't work)

  1. #1
    Ext User
    Join Date
    Jul 2008
    Posts
    32
    Vote Rating
    0
      0  

    Default placing a space inside a label (  doesn't work)

    Is there a way to place multiple spaces inside a label (between actual text).

    For example, lets say I have the text: '100 %' (bit of an extreme example), when rendered, it shows up as: '100 %'.

    All of the spaces are truncated into 1.

    Any ideas?

  2. #2
    Ext User zhegwood's Avatar
    Join Date
    Dec 2007
    Location
    Boulder, CO Suburbia (Lafayette)
    Posts
    388
    Vote Rating
    1
      0  

    Default

    Haven't tried it, but if   doesn't work maybe try a transparent image?

  3. #3
    Ext User
    Join Date
    Jul 2008
    Posts
    32
    Vote Rating
    0
      0  

    Default

    I've tried ' ' & '\s', but neither worked. They actually resolve

    I didn't try an image, as it seems like a bit of overkill. I suppose I could do that if I had no other options

  4. #4
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    0
      0  

    Default

    Multiple   strings should work. Note that you may also have to escape the & as &

  5. #5
    Ext User
    Join Date
    Jul 2008
    Posts
    32
    Vote Rating
    0
      0  

    Default

    I tried both   as well as &ampnbsp;

    but nether seemed to work.

  6. #6
    Sencha Premium Member tjstuart's Avatar
    Join Date
    May 2007
    Location
    Sydney, Australia
    Posts
    457
    Vote Rating
    32
      0  

    Default

    What kind of label? Couldn't you just create a span and set a margin on it eg.

    PHP Code:
    a<span style="margin-left:50px;">b</span

  7. #7
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    0
      0  

    Default

    Just updated the dynamic form example's first field to be
    Code:
                    fieldLabel: 'First&nbsp;&nbsp;Name',
                    name: 'first',
                    allowBlank:false
    and it correctly displays 2 spaces. What are you doing differently?

  8. #8
    Ext User
    Join Date
    Jul 2008
    Posts
    32
    Vote Rating
    0
      0  

    Default

    I was just using the Label class:
    Code:
    label = new Ext.form.Label({ text: '10&nbsp;&nbsp;&nbsp;%'});
    I also tried using the setText function of the label class.

  9. #9
    Sencha User
    Join Date
    Mar 2007
    Posts
    7,854
    Vote Rating
    0
      0  

    Default

    Per the doc, you need to use the 'html' config instead of the 'text' config in that case. Also, if your call setText, you need to pass false as the 2nd arg.

  10. #10
    Ext User
    Join Date
    Jul 2008
    Posts
    32
    Vote Rating
    0
      0  

    Default

    thanks for pointing that out...feel a bit retarded that I didn't notice that...

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •