CA
Problemas em Datagrid Responsivo
Preciso saber o que estou fazendo de errado nesta class. Apenas a ultima coluna aparece quando a tela é redimensionada conforme imagem anexada.
- <?php
- class AcompanhamentoSeletivo extends TStandardList
- {
- protected $form; // form
- protected $loaded;
- protected $grid;
- protected $transformCallback;
- function __construct($param)
- {
- parent::__construct();
- $table = new TTable();
- $table->width = '100%';
- // creates the form
- $this->form = new TForm('form_acompanhamento_seletivo');
- $this->form->class = 'tform';
- $this->form->style = 'max-width: 1000px; margin:auto; margin-top:40px;';
- // add the notebook inside the form
- $this->form->add($table);
- $row=$table->addRow();
- $row->addCell( new TLabel('Seletivos Inscritos') );
- $row->class='tformtitle';
- // creates a DataGrid
- $this->datagrid = new BootstrapDatagridWrapper(new TDataGrid);
- $this->datagrid->style = 'width: 99%';
- $this->datagrid->datatable = 'true';
- $this->datagrid->setHeight(320);
- // creates the datagrid columns
- $column_id = new TDataGridColumn('id', 'Id', 'center', '5%');
- $column_insc = new TDataGridColumn('inscricaoFormatada', 'Inscrição', 'left', '10%');
- $column_datainsc = new TDataGridColumn('datainscricaoBR', 'Data Inscrição', 'left', '10%');
- $column_name = new TDataGridColumn('descricao_seletivo', 'Objeto da Seleção', 'left', '40%');
- $column_login = new TDataGridColumn('local_seletivo', 'Local de Trabalho', 'left', '15%');
- $column_inicio = new TDataGridColumn('datainicio_seletivoBR', 'Início', 'left', '10%');
- $column_final = new TDataGridColumn('datafinal_seletivoBR', 'Término', 'left', '10%');
- // add the columns to the DataGrid
- $this->datagrid->addColumn($column_id);
- $this->datagrid->addColumn($column_insc);
- $this->datagrid->addColumn($column_datainsc);
- $this->datagrid->addColumn($column_name);
- $this->datagrid->addColumn($column_login);
- $this->datagrid->addColumn($column_inicio);
- $this->datagrid->addColumn($column_final);
- // creates the datagrid column actions
- $order_id = new TAction(array($this, 'onReload'));
- $order_id->setParameter('order', 'id');
- $column_id->setAction($order_id);
- $order_name = new TAction(array($this, 'onReload'));
- $order_name->setParameter('order', 'descricao_seletivo');
- $column_name->setAction($order_name);
- $order_login = new TAction(array($this, 'onReload'));
- $order_login->setParameter('order', 'local_seletivo');
- $column_login->setAction($order_login);
- // create CARTAO action
- $action_edit = new TDataGridAction(array($this, 'onPrint'));
- $action_edit->setButtonClass('btn btn-default');
- $action_edit->setLabel('Cartão Inscrição');
- $action_edit->setImage('fa:credit-card red fa-lg');
- $action_edit->setField('id');
- $this->datagrid->addAction($action_edit);
- // create the datagrid model
- $this->datagrid->createModel();
- $row=$table->addRow();
- $row->addCell( $this->datagrid );
- // create the page navigation
- $this->pageNavigation = new TPageNavigation;
- $this->pageNavigation->setAction(new TAction(array($this, 'onReload')));
- $this->pageNavigation->setWidth($this->datagrid->getWidth());
- $row=$table->addRow();
- $row->addCell( $this->pageNavigation );
- $bc = new TBreadCrumb();
- $bc->setHomeController('BemVindo');
- $bc->addHome();
- $bc->addItem('Acompanhamento de Seletivos Inscritos');
- // vertical box container
- $container = new TVBox;
- $container->style = 'width: 100%';
- $container->add($bc);
- $container->add($this->form);
- parent::add($container);
- }
- ?>
Nos testes que fiz aqui, essa questão de colocar a grid dentro de uma tabela estava "quebrando" um pouco a responsividade. Tenta adicioná-la diretamente ao container principal: