Project

General

Profile

Exceed the cell space in a WTableView

Added by Jockel Meierthiele about 6 years ago

Hello,

I am trying to create custom editors for a WTableView and I have problems to give these editor the required size.

So I have a item-delegate (derived from Wt::WItemDelegate) and I have implemented the createEditor function like this:

Wt::WWidget* MyDelegate::createEditor(const Wt::WModelIndex &index,
                                           Wt::WFlags<Wt::ViewItemRenderFlag> flags) const
{
    Wt::WContainerWidget* container = new Wt::WContainerWidget();
    Wt::WContainerWidget* absoluteContainer = new Wt::WContainerWidget(container);

    absoluteContainer->decorationStyle().setBackgroundColor(Wt::green);
    absoluteContainer->setPositionScheme(Wt::Absolute);
    absoluteContainer->resize(400, 400);
    absoluteContainer->setMinimumSize(400, 400);
    absoluteContainer->setZIndex(999);

The result is, that the 'green' container at least exceeds the cells below it,

but the container is behind the cells right of it and outside the WTableView it is also not visible.

Any ideas how to give an editor a fixed size, which is always visible regardless the cell- or table size?

Thank you


Replies (2)

RE: Exceed the cell space in a WTableView - Added by Mark Petryk about 6 years ago

It's hard for me to envision what you're describing. Can you take a screen shot and paste it in here?

RE: Exceed the cell space in a WTableView - Added by Jockel Meierthiele about 6 years ago

Hello,

in the picture, you can see the red-container, which is much smaller than it should be.

Or to be more precise, it has the correct size, but it is hidden by the 'double'-column and the

bounds of the table.

My aim is to make the complete container visible.

table example

table.png (6.92 KB) table.png table example
    (1-2/2)