RA
setGroupColumn não agrupa
Pessoal, porque não está agrupando?
- <?php
- /**
- * EstoqueFormView Master/Detail
- * @author <your name here>
- */
- class EstoqueFormView extends TPage
- {
- protected $form; // form
- protected $detail_list;
- /**
- * Page constructor
- */
- public function __construct($param)
- {
- parent::__construct();
- TTransaction::open('projeto');
- $this->form = new BootstrapFormBuilder('form_Estoque');
- $this->form->setFormTitle('Estoque');
- $master_object = new Estoque($param['key']);
- $label_id = new TLabel('Id:', '#333333', '12px', '');
- $label_cadastro_id = new TLabel('Responsável:', '#333333', '12px', '');
- $label_tabela_produtos_id = new TLabel('Produto:', '#333333', '12px', '');
- $label_qtd_estoque = new TLabel('Qtd Estoque:', '#333333', '12px', '');
- $text_id = new TTextDisplay($master_object->id, '#333333', '12px', '');
- $text_cadastro_id = new TTextDisplay($master_object->cadastro_id, '#333333', '12px', '');
- $text_tabela_produtos_id = new TTextDisplay($master_object->tabela_produtos_id, '#333333', '12px', '');
- $text_qtd_estoque = new TTextDisplay($master_object->qtd_estoque, '#333333', '12px', '');
- $this->form->addFields([$label_id],[$text_id]);
- $this->form->addFields([$label_cadastro_id],[$text_cadastro_id]);
- $this->form->addFields([$label_tabela_produtos_id],[$text_tabela_produtos_id]);
- $this->detail_list = new TQuickGrid;
- $this->detail_list->style = 'width:100%';
- $this->detail_list->disableDefaultClick();
- // define the group column and group mask pattern
- $this->detail_list->setGroupColumn('tipo_movimento', '<b>Tipo de Movimento</b>: <i>{tipo_movimento}</i>');
- $this->detail_list->addQuickColumn('Produto', 'tabela_produtos_id', 'left');
- $this->detail_list->addQuickColumn('Tipo Movimento', 'tipo_movimento', 'left');
- $this->detail_list->addQuickColumn('Qtd Movimento', 'qtd_movimento', 'left');
- $this->detail_list->addQuickColumn('Data Movimento', 'data_movimento', 'left');
- $this->detail_list->createModel();
- $items = EstoqueMovimento::where('estoque_id', '=', $master_object->id)->load();
- $this->detail_list->addItems($items);
- $panel = new TPanelGroup('Itens', '#f5f5f5');
- $panel->add(new BootstrapDatagridWrapper($this->detail_list));
- $this->form->addContent([$panel]);
- $this->form->addHeaderAction('Editar', new TAction(['EstoqueForm', 'onEdit'],['key'=>$master_object->id]), 'fa:pencil-square-o blue');
- // vertical box container
- $container = new TVBox;
- $container->style = 'width: 90%';
- // $container->add(new TXMLBreadCrumb('menu.xml', 'EstoqueList'));
- $container->add($this->form);
- TTransaction::close();
- parent::add($container);
- }
- public function onLoad($param)
- {
- }
- }?>
Estou com esse mesmo problema.
Quando o valor está nulo, não agrupa e fica aparecendo vários registros no grid.