jstree
jstree copied to clipboard
Break line if node text exceeds container width
We have a very simple page layout. Left column (col-4
) displays jsTree and right column (col-8
) displays relevant data about the selected node. We noticed that jsTree doesn't break node name if it exceeds the column width. This is the code that we have (online demo):
<div class="container">
<div class="row">
<div class="col-4 border border-success">
<div id="jstree_demo_div"></div>
</div>
<div class="col-8 border border-danger">
<p>Hello world</p>
</div>
</div>
</div>
$(document).ready(function() {
$('#jstree_demo_div').jstree({
'core': {
'data': [
'Simple root node with a very long name which will overflow to the right container'
]
}
});
});
This is how it looks like:
How can we break node text in multiple lines if it exceeds the column width?