adjustRowHeight
adjusts row height to cell content
function adjustRowHeight( // column id columnId?: string, // apply the method without repainting silent?: boolean): void
Example
Section titled “Example”//adjusts height of each row to "title" cellsdtable.adjustRowHeight("title");
//adjusts height of each row to the highest cell in itdtable.adjustRowHeight();
also check the next samples:
Details
Section titled “Details”You need to set fixedRowHeight to false for your datagrid, otherwise the method will not have any visible result.
Row height is adjusted to:
- the height of the cell in a column, which is defined by the columnId parameter;
- the height of the “biggest” cell in a row, if columnId is not provided.
If you want to apply auto-sizing just after data loading you can do it inside the onResize event handler. Please, note that we can call the adjustRowHeight method in a silent mode because in this case the component will be refreshed automatically:
webix.grid({ columns:[ { id:"rank", width:40, header:"", css:"rank"}, { id:"title", width:380, header:"Film title" }, { id:"year", width:160, header:"Released" }, { id:"votes", width:120, header:"Votes" } ], fixedRowHeight:false, on:{ "onresize":webix.once(function(){ // adjust by "title" column this.adjustRowHeight("title", true); // or, adjust by any column this.adjustRowHeight(null, true); }) }});
See also
Section titled “See also”Articles