Salman hassan
Salman hassan

Reputation: 398

how to break a long label in many lines in Extjs

so here is my problem i wanna put a label before a fieldset and the label text is very long.and i need to have this long text in three rows/line. i used width, minWidth, margins, etc but not working. Is there is another easy way to ix it? I hope you people understand my question.

{
   xtype: 'container',
   layout: {
      type: 'hbox',
      align: 'stretch',
   },
   items:[,
      {
		  xtype: 'label',
		  minWidth: 200,
		  text: 'Hard Surface Flooring and Base: Attach         asddsad that asdasd enter hsjsa description[enter image description here][1] hersahaksjecomplies with asd or CA01350 Note:asdhjasd-based products such as asdads  tile are exempt',
		  marginRight:
      },
      {
          xtype: 'textfield',
      },
   ]
}

Upvotes: 1

Views: 2896

Answers (1)

Alexander
Alexander

Reputation: 20224

Don't use a label. Use container and fill the html config.

Detailed answer:

The label component can only play out its strength if you connect it to a field that can be focused when the label is clicked.

The wrapping of the label content of ExtJS form fields is done by the Labelable mixin, not by the label. A fieldset does not have the Labelable mixin, since it has no field.

Which is why you don't need a label, you need something that is intended to just take space in a layout and show some text. Like a container is.

Upvotes: 1

Related Questions