PDA

View Full Version : Label nowrap issue



AJAIN32
26 May 2014, 3:54 AM
Hi,

I am trying to place a label in a container and it is simple static text having 3-4 lines.

I am using label and tried some things to make the label text into multiple line.

I have used html also and with <br> i am able to make it multilined but when i apply border it's not looking proper.

can any one please tell me that with the label's text property can we have multiline text that will break according to the width???

Gary Schlosberg
29 May 2014, 2:58 PM
I'm probably missing something, but I was able to get a form field label to wrap quite easily. Can you post some code? Also helpful would be an image of the label displaying poorly with the border.

Gary Schlosberg
29 May 2014, 3:28 PM
Oops, forgot the Fiddle:
https://fiddle.sencha.com/#fiddle/67c

AJAIN32
30 May 2014, 12:22 AM
Sorry for Late reply,

{
xtype : 'label',
style : 'border: 1px solid #000000 !important'
html: 'TestTestTestTestTestTestTestTest<br>TestTestTestTestTestTestTestTestTest<br>TestTestTestTestTestTestTest '
}

I have attached the image of that label, and i have also tried with white-space:normal property as well.
but its going in a single line if i use text property. and with html attribute i am able to break the line but border is getting distroyed.

I believe, with the label width it should automatically break the long text into multiple lines.but in this case i guess we need to override the nowrap property of label.

Any idea ??

Thanks
Ankit