Hi,
I need to make a menú sidebar , but a have items where his value is to long,
There are some way to fix this and make the height auto and adjust de text.
Please check snippet code https://snippet.webix.com/4ewm5how
Thanks so much in advance!!
Hi,
I need to make a menú sidebar , but a have items where his value is to long,
There are some way to fix this and make the height auto and adjust de text.
Please check snippet code https://snippet.webix.com/4ewm5how
Thanks so much in advance!!
Hello @jorge,
You can use webix.html.getTextSize helper to calculate the width that should be set as width:
view: "sidebar",
on:{
onAfterLoad: function(){
var maxWidth =0;
this.data.each(function(item){
var size = webix.html.getTextSize(item.value);
var width = 70 + size.width;
if(width > maxWidth)
maxWidth = width;
});
this.define("width",maxWidth);
this.resize();
}
},...
Here is the demo that shows how to calculate the width:
https://snippet.webix.com/o5isr5ou
Hello @annazankevich
Thank you very much for the quick reply, but is it possible for each item to grow in height while maintaining a width of for example 250?
My bosses don’t like that the menu is so wide
Thanks in advance!!