Author Topic: Manual Height of the rows  (Read 2357 times)

SureshB

  • Pro Ultimate
  • Newbie
  • *
  • Posts: 32
    • View Profile
Manual Height of the rows
« on: July 03, 2015, 03:47:54 pm »
Hi ,

Can we provide height of the rows in the grid manually?

thank you.

paramvir

  • Administrator
  • Hero Member
  • *****
  • Posts: 6309
    • View Profile
Re: Manual Height of the rows
« Reply #1 on: July 03, 2015, 05:52:08 pm »
It can't be set directly because table cells expand in height based on their content.

Setting min-height is easy. It can be done thorugh JSON format or attr() method.

{ dataIndx, value1, ... pq_rowattr: { style: 'min-height:50px;' } }

attr({
  rowData, rowData,
  attr: { style: 'min-height:50px;'  }
})

max-height can be set by wrapping the cell contents in a div and setting max-height on that div. It can be done at once in columnTemplate or individual columns.

columnTemplate: {render: function(ui){
    var rowData = ui.rowData;
    //set max-height based on rowData or a fixed value.
    return "<div style='max-height:50px;overflow:auto;'>"+ui.cellData +"</div>";
}},
« Last Edit: July 03, 2015, 05:56:25 pm by paramquery »