MF
TNotebook - Um quickgrid para cada pagina
Fechado
Bom dia. Estou enfrentando dificuldades para incluir mais de um quickgrid em tnotebook. A grid da primeira pagina fica certinho, porém o da segunda fica abaixo do frame. Segue código abaixo, não encontrei ainda onde está o erro.
- <?php
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- /**
- * Description of DetalheValores
- *
- * @author matheus
- */
- class note extends TPage{
- //put your code here
- private $form;
- private $datagrid;
- //private $datagrid_boletos;
-
- function __construct()
- {
- parent::__construct();
-
- $this->form = new TForm('Detalhe_Valores');
-
- // creates the notebook
- $notebook = new TNotebook(920,500);
- $this->form->add($notebook);
-
- // creates the containers for each notebook page
- $table = new TTable;
- $table_boleto = new TTable;
-
-
- // adds two pages in the notebook
- $this->datagrid = new TQuickGrid;
- $this->datagrid->setHeight(230);
- $this->datagrid->addQuickColumn('Plano', 'plano', 'right', 40);
- $this->datagrid->addQuickColumn('Parcela', 'parcela', 'left', 40);
- $this->datagrid->createModel();
- $table->add($this->datagrid);
- $notebook->appendPage('Valores', $table);
-
- $this->datagrid = new TQuickGrid;
- $this->datagrid->setHeight(280);
- $this->datagrid->addQuickColumn('Hora', 'hora', 'left', 100);
- $this->datagrid->addQuickColumn('Vencimento', 'datavenc', 'left', 100);
- $this->datagrid->addQuickColumn('Valor do boleto', 'valdoc', 'center', 100);
- $this->datagrid->addQuickColumn('Crédito', 'credito', 'left', 100);
- $this->datagrid->addQuickColumn('Valor Pago', 'valpago', 'left', 100);
- $this->datagrid->createModel();
-
- $row = $table_boleto->addRow();
- $row->addCell(new TLabel('TESTE'));
- $table_boleto->add($this->datagrid);
- $notebook->appendPage('Boletos', $table_boleto);
-
- $table_layout = new TTable;
- $table_layout->addRow()->addCell($notebook);
- // add the notebook inside the page
- parent::add($table_layout);
- }
- }
- ?>
Olá, neste caso creio que pode usar o TNotebook como único container, sem necessidade de um TTable. Siga este exemplo e verifique se te atende:
Caso precise adicionar mais elementos na aba boletos pode sim, criar um TTable para organizar o layout, desta form:
.....
.........
Logo após postar minha dúvida, consegui fazer da primeira maneira que você falou, depois precisava colocar outros campos e o problema voltou, o segundo código postado resolveu o problema. Obrigado.