Project

General

Profile

Table model header

Added by Jakub Pavelka almost 5 years ago

Hello,

I wonder if i can make Wt::WStandardItemModel with headers attached to rows and not columns.

I tried changin' Oriantation flag... just gave me some errors.

So I made a special column for headersby myself but there's still one row (not filled) acting like a headerrow.

Is there any method to do that because I can't find it?

Thanks


Replies (2)

RE: Table model header - Added by Roel Standaert over 4 years ago

Row headers behave a bit different from column headers in a WTableView.

You can just make the first column (or first N columns) into headers by setting setRowHeaderCount(N).

If you want to get rid of the column headers at the top, you can set its height to 0 with setHeaderHeight(0).

You could maybe also give the first row a different font size, background color, etc., using CSS as long as that doesn't change the size (.Wt-tv-c1 is the class used for the first column), or a custom WItemDelegate for that column (WAbstractItemView::setItemDelegateForColumn()), or setting some class on that column's elements with the StyleClass ItemDataRole.

Regards,

Roel

RE: Table model header - Added by Jakub Pavelka over 4 years ago

Yeah, the size change is OK!

many thanks :)

    (1-2/2)