Actions
Support #1233
closed
AC
WTableView Column Width does not work.
Support #1233:
WTableView Column Width does not work.
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?
KD Updated by Koen Deforche over 14 years ago
Hey,
This probably should be documented better, but, you should first set a model for the tableview.
Regards,
koen
KD Updated by Koen Deforche over 14 years ago
Hey,
Also: you can't use percentage widths --- they have to be pixel widths.
Regards,
koen
KD Updated by Koen Deforche about 14 years ago
- Status changed from New to Closed
Actions