Project

General

Profile

Actions

Support #1233

closed

WTableView Column Width does not work.

Added by Alexander David Cruz Márquez over 12 years ago. Updated over 12 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Target version:
Start date:
04/12/2012
Due date:
% Done:

0%

Estimated time:

Description

Hi, I have this code

    WContainerWidget * _tableContent = new WContainerWidget();

    WContainerWidget * _options = new WContainerWidget();

    _btnAdd = new WPushButton(WString::tr("scds.http.proxy.add"));
    _btnDel = new WPushButton(WString::tr("scds.http.proxy.del"));
    _btnEdit = new WPushButton(WString::tr("scds.http.proxy.edit"));

    _options->addWidget(_btnAdd);
    _options->addWidget(_btnDel);
    _options->addWidget(_btnEdit);
    _options->setContentAlignment(Wt::AlignRight);


    _tableView = new WTableView();
    _tableView->setWidth("100%");
    _tableView->setHeight("380px");
    _tableView->setColumnResizeEnabled(true);
    _tableView->setSortingEnabled(true);       
    _tableView->setColumnWidth(0, "0%");
    _tableView->setColumnWidth(1, "50%");
    _tableView->setColumnWidth(2, "20%");
    _tableView->setColumnWidth(3, "20%");
    _tableView->setSelectionBehavior(Wt::SelectRows);
    _tableView->setSelectionMode(Wt::SingleSelection);
    _tableView->setAlternatingRowColors(true);
    _tableView->setColumnHidden(0, true);


    _tableContent->addWidget(_options);
    _tableContent->addWidget(_tableView);

in this case, _tableView Column Width does not set, those stay on 156px width.
what is wrong?

Actions #1

Updated by Koen Deforche over 12 years ago

Hey,

This probably should be documented better, but, you should first set a model for the tableview.

Regards,

koen

Actions #2

Updated by Koen Deforche over 12 years ago

Hey,

Also: you can't use percentage widths --- they have to be pixel widths.

Regards,

koen

Actions #3

Updated by Koen Deforche over 12 years ago

  • Status changed from New to Closed
Actions

Also available in: Atom PDF