Mark@Lorimark Solutions
2015-09-08 21:12:29 UTC
We are trying to make the WTableView responsive. Right now the
right-side of the table view appears to be responsive as it pertains to
the width of the browser. But, the bottom of the Table is not. Is is
only setting its size either fixed, according to what we set it to in
code, or in Auto it takes up the amount of space required to display all
of the table data.
How can we make the bottom of the WTableView also responsive to the
parent container? (note the comment on line 514)
------------------------------------------------------------------------------
right-side of the table view appears to be responsive as it pertains to
the width of the browser. But, the bottom of the Table is not. Is is
only setting its size either fixed, according to what we set it to in
code, or in Auto it takes up the amount of space required to display all
of the table data.
How can we make the bottom of the WTableView also responsive to the
parent container? (note the comment on line 514)
478 Wt::WContainerWidget *container = new Wt::WContainerWidget;·
479 ·
480 Wt::WVBoxLayout * layout = new Wt::WVBoxLayout( container );·
481 ·
482 Wt::Dbo::Transaction t(*dboSession);·
485 Wt::Dbo::Query< Wt::Dbo::ptr<MKT::Referrer> > query;·
486 query = dboSession-> find<MKT::Referrer>(); // .limit(100);·
487 ·
491 modelReferrer = new Wt::Dbo::QueryModel< Wt::Dbo::ptr<MKT::Referrer> >();·
492 modelReferrer-> setQuery( query );·
493 ·
494 modelReferrer-> addColumn( "id" );·
495 modelReferrer-> addColumn( SYS::KeyField );·
496 modelReferrer-> addColumn( MKT::Referrer::AbbreviationField );·
504 ·
505 layout-> addWidget( new Wt::WText(title) );·
506 ·
507 tableViewReferrer = new Wt::WTableView();·
508 tableViewReferrer-> setSelectionMode( Wt::SingleSelection );·
509 tableViewReferrer-> setModel( modelReferrer );·
510 ·
511 tableViewReferrer-> setMargin( Wt::WLength::Auto, Wt::Left | Wt::Right );·
512 tableViewReferrer-> setColumnResizeEnabled( true );·
513 tableViewReferrer-> setAlternatingRowColors( true );·
514 tableViewReferrer-> setHeight( 400 );· <-------------this sets the TableViewHeight fixed
515 · we want the height responsive
516 layout-> addWidget( tableViewReferrer );·
517 ·
518 return container;·
519 }·
~mark479 ·
480 Wt::WVBoxLayout * layout = new Wt::WVBoxLayout( container );·
481 ·
482 Wt::Dbo::Transaction t(*dboSession);·
485 Wt::Dbo::Query< Wt::Dbo::ptr<MKT::Referrer> > query;·
486 query = dboSession-> find<MKT::Referrer>(); // .limit(100);·
487 ·
491 modelReferrer = new Wt::Dbo::QueryModel< Wt::Dbo::ptr<MKT::Referrer> >();·
492 modelReferrer-> setQuery( query );·
493 ·
494 modelReferrer-> addColumn( "id" );·
495 modelReferrer-> addColumn( SYS::KeyField );·
496 modelReferrer-> addColumn( MKT::Referrer::AbbreviationField );·
504 ·
505 layout-> addWidget( new Wt::WText(title) );·
506 ·
507 tableViewReferrer = new Wt::WTableView();·
508 tableViewReferrer-> setSelectionMode( Wt::SingleSelection );·
509 tableViewReferrer-> setModel( modelReferrer );·
510 ·
511 tableViewReferrer-> setMargin( Wt::WLength::Auto, Wt::Left | Wt::Right );·
512 tableViewReferrer-> setColumnResizeEnabled( true );·
513 tableViewReferrer-> setAlternatingRowColors( true );·
514 tableViewReferrer-> setHeight( 400 );· <-------------this sets the TableViewHeight fixed
515 · we want the height responsive
516 layout-> addWidget( tableViewReferrer );·
517 ·
518 return container;·
519 }·
------------------------------------------------------------------------------