Column background image

Hi,

I need to display some vertical grid lines behind an entire, single column in a dhtmlxgrid. I’ve tried using repeated CSS background images in each cell of the applicable column, but then the grid displays only behind the cells, potentially leaving a large grid-less space if the table only contains e.g. 3 rows.
Any suggestions?

Thanks,

Robert.

Please provide code snipped and screenshot where we can reproduce this issue.

Hi Olga,

Please find some sample code and a screen shot attached.
Hope you can help!
Best regards,

Robert.


If you don’t what this white space under grid rows you can try to switch on auto height mode:

mygrid.enableAutoHeight(true);

Otherwise you should set the same background for the div.gridbox .objbox:

div.gridbox .objbox{
//
}

Enabling auto height is a good workaround, thanks. But if I apply the same background to the objbox, then the grid lines would be displayed behind all columns instead of just behind column ‘B’, wouldn’t they?

But if I apply the same background to the objbox, then the grid lines would be displayed behind all columns instead of just behind column ‘B’, wouldn’t they?

Yes, it is. But using css you can specify background image position.

Yikes… I’d have to take column moves, column width changes, column hidings etc. into account to determine where the grid lines should be positioned exactly on the objbox. Is there some central event that fires when either of these happen?

I’d have to take column moves, column width changes, column hidings etc.
In such case it will be quite tricky to achieve your requirements. Isn’t it better to use auto height mode?

column moves
onAfterCMove
docs.dhtmlx.com/doku.php?id=dhtm … naftermove

column width changes
onResizeEnd
docs.dhtmlx.com/doku.php?id=dhtm … nresizeend

column hidings
onColumnHidden
docs.dhtmlx.com/doku.php?id=dhtm … lumnhidden