Bug #5889
openWTreeView loooks bad after data update
0%
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
Updated by Roel Standaert about 7 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.
Updated by Daniel Lier about 7 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());