Project

General

Profile

Actions

Bug #3662

closed

WTreeTable doesn't render empty (or whitespace) WText column widgets correctly

Added by Patrick Oppenlander over 9 years ago. Updated about 9 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

If a column widget in a WTreeTable is set to

setColumnWidget(3, new Wt::WText(""));

the generated html omits a height attribute for the column div.

<div id="o5waupr" style="float:left;width:125.0px;"></div>

This means that any columns to the right float too far to the left.

Normally an empty column looks like this:

<div id="o5waupp" style="float:left;width:125.0px;height:1.0px;"> </div>
Actions #1

Updated by Patrick Oppenlander over 9 years ago

This bug has a workaround.

Use this code when you expect empty text:

// HACK: shouldn't need to set height
Wt::WText *text = new Wt::WText(s);
if (s.empty())
    text->setStyleClass("height_1");
setColumnWidget(Column, baytext);

With this CSS somewhere:

/*
 * HACK: workaround for empty WTreeTable cell glitch
 */
.height_1 {
    height: 1px;
}
Actions #2

Updated by Koen Deforche over 9 years ago

  • Status changed from New to InProgress
  • Assignee set to Koen Deforche

I believe I might have fixed this already but I'll check

Actions #3

Updated by Koen Deforche about 9 years ago

  • Status changed from InProgress to Resolved
  • Target version set to 3.3.4

Thanks, you're right, this still needed fixing.

Actions #4

Updated by Koen Deforche about 9 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF