Support #1233
WTableView Column Width does not work.
| Status: | Closed | Start date: | 04/12/2012 | |
|---|---|---|---|---|
| Priority: | Normal | Due date: | ||
| Assignee: | - | % Done: | 0% | |
| Category: | - | |||
| Target version: | 3.2.0 |
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?
History
#1 Updated by Koen Deforche about 1 year ago
Hey,
This probably should be documented better, but, you should first set a model for the tableview.
Regards,
koen
#2 Updated by Koen Deforche about 1 year ago
Hey,
Also: you can't use percentage widths -- they have to be pixel widths.
Regards,
koen
#3 Updated by Koen Deforche 11 months ago
- Status changed from New to Closed