adjustRowHeight

adjusts row height to cell content

void adjustRowHeight( [string columnId,boolean silent] );

Parameters

columnIdstringcolumn id
silentbooleanapply the method without repainting

Example

//adjusts height of each row to "title" cells
dtable.adjustRowHeight("title");
 
//adjusts height of each row to the highest cell in it
dtable.adjustRowHeight();

Related samples

Details

You need to set fixedRowHeight to false for your datatable, 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 use the following code:

webix.ui({
    view:"datatable",
    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(){ 
            this.adjustRowHeight("title", true); 
        })
    }
});

This method will slowdown a component a lot.

See also
Back to top
If you have not checked yet, be sure to visit site of our main product Webix javascript ui library and page of javascript excel grid product.