TNotebook - Um quickgrid para cada pagina 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. ...
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.

 
  1. <?php
  2. /*
  3. * To change this template, choose Tools | Templates
  4. * and open the template in the editor.
  5. */
  6. /**
  7. * Description of DetalheValores
  8. *
  9. * @author matheus
  10. */
  11. class note extends TPage{
  12. //put your code here
  13. private $form;
  14. private $datagrid;
  15. //private $datagrid_boletos;
  16. function __construct()
  17. {
  18. parent::__construct();
  19. $this->form = new TForm('Detalhe_Valores');
  20. // creates the notebook
  21. $notebook = new TNotebook(920,500);
  22. $this->form->add($notebook);
  23. // creates the containers for each notebook page
  24. $table = new TTable;
  25. $table_boleto = new TTable;
  26. // adds two pages in the notebook
  27. $this->datagrid = new TQuickGrid;
  28. $this->datagrid->setHeight(230);
  29. $this->datagrid->addQuickColumn('Plano', 'plano', 'right', 40);
  30. $this->datagrid->addQuickColumn('Parcela', 'parcela', 'left', 40);
  31. $this->datagrid->createModel();
  32. $table->add($this->datagrid);
  33. $notebook->appendPage('Valores', $table);
  34. $this->datagrid = new TQuickGrid;
  35. $this->datagrid->setHeight(280);
  36. $this->datagrid->addQuickColumn('Hora', 'hora', 'left', 100);
  37. $this->datagrid->addQuickColumn('Vencimento', 'datavenc', 'left', 100);
  38. $this->datagrid->addQuickColumn('Valor do boleto', 'valdoc', 'center', 100);
  39. $this->datagrid->addQuickColumn('Crédito', 'credito', 'left', 100);
  40. $this->datagrid->addQuickColumn('Valor Pago', 'valpago', 'left', 100);
  41. $this->datagrid->createModel();
  42. $row = $table_boleto->addRow();
  43. $row->addCell(new TLabel('TESTE'));
  44. $table_boleto->add($this->datagrid);
  45. $notebook->appendPage('Boletos', $table_boleto);
  46. $table_layout = new TTable;
  47. $table_layout->addRow()->addCell($notebook);
  48. // add the notebook inside the page
  49. parent::add($table_layout);
  50. }
  51. }
  52. ?>

Curso Dominando o Adianti Framework

O material mais completo de treinamento do Framework.
Curso em vídeo aulas + Livro completo + Códigos fontes do projeto ERPHouse.
Conteúdo Atualizado!


Dominando o Adianti Framework Quero me inscrever agora!

Comentários (3)


AN

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:

 
  1. <?php
  2. class Teste extends TPage{
  3. private $form;
  4. private $datagrid;
  5. private $datagrid_boletos;
  6. function __construct()
  7. {
  8. parent::__construct();
  9. $this->form = new TForm('Detalhe_Valores');
  10. $notebook = new TNotebook(920,500);
  11. $this->form->add($notebook);
  12. $this->datagrid = new TQuickGrid;
  13. $this->datagrid->setHeight(230);
  14. $this->datagrid->addQuickColumn('Plano', 'plano', 'right', 40);
  15. $this->datagrid->addQuickColumn('Parcela', 'parcela', 'left', 40);
  16. $this->datagrid->createModel();
  17. $notebook->appendPage('Valores', $this->datagrid);
  18. $this->datagrid_boletos = new TQuickGrid;
  19. $this->datagrid_boletos->setHeight(280);
  20. $this->datagrid_boletos->addQuickColumn('Hora', 'hora', 'left', 100);
  21. $this->datagrid_boletos->addQuickColumn('Vencimento', 'datavenc', 'left', 100);
  22. $this->datagrid_boletos->addQuickColumn('Valor do boleto', 'valdoc', 'center', 100);
  23. $this->datagrid_boletos->addQuickColumn('Crédito', 'credito', 'left', 100);
  24. $this->datagrid_boletos->addQuickColumn('Valor Pago', 'valpago', 'left', 100);
  25. $this->datagrid_boletos->createModel();
  26. $notebook->appendPage('Boletos', $this->datagrid_boletos);
  27. parent::add($notebook);
  28. }
  29. }
  30. ?>

AN

Caso precise adicionar mais elementos na aba boletos pode sim, criar um TTable para organizar o layout, desta form:

.....
$table = new TTable; $row = $table->addRow(); $row->addCell(new TLabel('Teste')); $row = $table->addRow(); $row->addCell($this->datagrid_boletos); $notebook->appendPage('Boletos', $table); parent::add($notebook);

.........
MF

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.