This is a migrated thread and some comments may be shown as answers.

Kendo Angular TreeView --> How to do Text wrap on node name

2 Answers 642 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Sankar
Top achievements
Rank 1
Sankar asked on 12 Jun 2018, 10:42 AM

Hi Team,

I have a requirement with fixed width (300px) - Treeview with 4 levels.

When I expand fourth level it has the node name with 100 chars maximum. so when size is not fit with tree view width, Node name should be wrapped and display in two lines in the treeview.

Please refer the screen shot, end of 4th level node some text missed

Note : I don't want horizontal scroll bar when it has big text and Node name wrapped proper alignment.

Thanks

2 Answers, 1 is accepted

Sort by
0
Accepted
Dimiter Topalov
Telerik team
answered on 12 Jun 2018, 01:52 PM
Hi Sankar,

You can overwrite the built-in TreeView styling so that the default behavior of text that would have overflown is this text to be wrapped, e.g.:

encapsulation: ViewEncapsulation.None,
  styles: [`
    .k-treeview .k-in {
      display: inline-block;
      white-space: normal;
    }
  `]

The following runnable example demonstrates the described approach:

https://plnkr.co/edit/zmEbfxUUNLcFpC6y7A5t?p=preview

I hope this helps.

Regards,
Dimiter Topalov
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Sankar
Top achievements
Rank 1
answered on 15 Jun 2018, 08:36 AM

Thanks.

This is working as expected.

Tags
General Discussions
Asked by
Sankar
Top achievements
Rank 1
Answers by
Dimiter Topalov
Telerik team
Sankar
Top achievements
Rank 1
Share this question
or