Project

General

Profile

layouts layouts layouts

Added by Mark Petryk almost 6 years ago

I love layouts, and I love WTableView and how I can get 100's of 1000's of rows of data to be able to 'scroll'. However, I struggle trying to get layouts to behave and I struggle trying to get WTableView to behave within those layouts. I was told that the "layouts" need to exist all the way down to the root() container. I do that... yet I struggle.

So, in this code, this is what I get:

475 #ifndef NEVER·
476 ·
477   //·
478   // this DOES NOT allow these WTableView to honor the layout and scroll as expected·
479   //·
480   auto u_tabWidget = std::make_unique<Wt::WTabWidget>();·
481   u_tabWidget-> addTab( std::move( std::make_unique< WarehouseCustomerWidget>  ( session() ) ), "customers" );·
482   u_tabWidget-> addTab( std::move( std::make_unique< WarehouseInventoryWidget> ( session() ) ), "inventory" );·
483   u_tabWidget-> addTab( std::move( std::make_unique< WarehouseCalendarWidget>  ( session() ) ), "calendar"  );·
484   u_tabWidget-> addTab( std::move( std::make_unique< WarehouseUsersWidget>     ( session() ) ), "users"     );·
485   u_tabWidget-> addTab( std::move( std::make_unique< WarehouseAdminWidget>     ( session() ) ), "admin"     );·
486   lw()-> addWidget( std::move( u_tabWidget ), 1 );·
487 ·
488 #else·
489 ·
490   //·
491   // this DOES allow the WTableView to 'fit' and 'scroll' as expected·
492   //·
493   lw()-> addWidget( std::move( std::make_unique< WarehouseCustomerWidget > ( session() ) ), 1 );·
494 ·
495 #endif·
496 ·

So, I know it has something to do with the tab-widget stacked-widget and that probably layouts need to be applied to that as well... but I'm unclear as to how?


Replies (2)

RE: layouts layouts layouts - Added by Mark Petryk almost 6 years ago

Found the solution (Thank you Rock!)

Not sure if this exposes a bug with flex, but the fix is to use a different layout "implementation"

 19 int main(int argc, char** argv)·
 20 {·
 21   Wt::WLayout::setDefaultImplementation( Wt::LayoutImplementation::JavaScript );·
 22 ·
 23   try·
 24   {·
 25     Wt::WServer server( argc, argv );·
 26 ·
 27     Wtx::Sys::Auth::configure();·
 28 ·

RE: layouts layouts layouts - Added by Stefan Bn over 2 years ago

I experienced the same issues. The JavaScript default implementation is no option for me.

I created an issue for this:

https://redmine.webtoolkit.eu/issues/9284

    (1-2/2)