Start Building Professional
Web Apps Today


 
Categories Question details Back To List
Question  posted by James Snyder on Jun 17, 2009 13:57
open dhtmlx forum
Row height issue

I'm having a small issue with row height. We need a blank row between some data and I would rather it be half the size of the other rows. However I am using the setRowTextStyle and it works at larger values (ie: 25px) but not for the smaller sizes. ( <10)

Any thoughts?

Thanks,
James



Here is the function

function gridAddRowSelectItemSection(sHeader) {
var sStyle = "color:#58585a;font-family:Arial;font-weight:bold;font-size:9pt;height:15px;";
var iRow = (grdSelectItems.getRowsNum() + 1);

//EXTRA ROW    
grdSelectItems.addRow(iRow,",,,,");
grdSelectItems.setRowTextStyle(0,"height:2px;");

grdSelectItems.addRow((iRow+1),sHeader+",,,,");
grdSelectItems.setRowTextStyle((iRow+1), sStyle);
}
Answer posted by dhxSupport on Jun 18, 2009 02:20
Rows height cannot be less then height of the row's content. If row is empty cells contain blank spaces (&nsbp;). Blank spaces have height also. Their height is determined as height of the font which is used for that row. So to reduce blank row height to 2px you shuould set font-size to 2px:
grdSelectItems.addRow(iRow,",,,,"); 
grdSelectItems.setRowTextStyle(iRow,"height:2px;font-size: 2px;");

Note that first parameter of setRowTextStyle() method is ID of a row, not row index. Please be aware of using "0" row's id. It can affect on some grid's funcionality.