Project

General

Profile

Actions

Bug #5889

open

WTreeView loooks bad after data update

Added by Daniel Lier over 6 years ago. Updated over 6 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
Start date:
08/23/2017
Due date:
% Done:

0%

Estimated time:

Description

Hello,

attached you'll find your TreeViewExample with some modifications.

-a model class is added where the data update needs to be done (various data might come from the DB with a different number of cols and rows)

-when updating data within the constructor of the model class everything is fine but when updating afterwards the WTreeView looks bad

-note: for testing the data update() is triggered when pressing any key

you'll have to add the files atttached to the according example project

I have almost this ccenario in my application and it looks even worse. The scroll bar on the right hand side moves the data to thte left so they are not aligned to the cloumn anymore (it's ok after scrolling). And the column size changing behaviour is weird too. When changing the width of the column on the right hand side, the left hand side is moving.

It looks to me that data are not removed from the view and/or any update or refresh is needed.

Thanks for your help!

Daniel


Files

TreeViewApplication.C (1.56 KB) TreeViewApplication.C Daniel Lier, 08/23/2017 12:56 PM
TreeViewExample.C (8.2 KB) TreeViewExample.C Daniel Lier, 08/23/2017 12:56 PM
TreeViewExample.h (1.56 KB) TreeViewExample.h Daniel Lier, 08/23/2017 12:56 PM
Actions #1

Updated by Roel Standaert over 6 years ago

Looks like this particular problem is caused by the column width being reset, because the model goes from 4 columns to 0 columns back to 4 columns. If you change the column width on column 0 after the update, then it looks ok again. I'm not sure yet what the best way would be to deal with this.

Actions #2

Updated by Daniel Lier over 6 years ago

Setting the width on column 0 does not help in my case. I found out that after resizing the WTreeView via ::setHeight the bad behaviour is gone and everything is ok.

I do:

pTreeView->setHeight(Wt::WLength(100));

pTreeView->setHeight(Wt::WLength());

Actions

Also available in: Atom PDF