Skip to content

Commit

Permalink
🔨 #7 uptede form to FormDin5-alpha8
Browse files Browse the repository at this point in the history
  • Loading branch information
bjverde committed Jul 21, 2020
1 parent c187577 commit 13eb372
Showing 1 changed file with 25 additions and 9 deletions.
34 changes: 25 additions & 9 deletions app/control/forms/MetaTipoForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,23 +21,39 @@ public function __construct()
$this->setDefaultOrder('idMetaTipo', 'asc'); // define the default order
$this->setLimit(-1); // turn off limit for datagrid

// create the form
/*****************************
// FORM ADIANTI 7.X
$this->form = new BootstrapFormBuilder('MetaTipo');
$this->form->setFormTitle('Meta Tipo');
// create the form fields
$id = new TEntry('cod_regiao');
$name = new TEntry('nom_regiao');
// add the form fields
$this->form->addFields( [new TLabel('ID', 'red')], [$id] );
$this->form->addFields( [new TLabel('Nome', 'red')], [$name] );
$name->addValidation('Name', new TRequiredValidator);
// define the form actions
$this->form->addAction( 'Save', new TAction([$this, 'onSave']), 'fa:save green');
$this->form->addActionLink( 'Clear',new TAction([$this, 'onClear']), 'fa:eraser red');
// make id not editable
$id->setEditable(FALSE);
*****************************/

// FORMDIN 5
$frm = new TFormDin('Meta Tipo');
$frm->addHiddenField('idMetaTipo');
$descricao = $frm->addTextField('descricao','Descrição',30,true);
$descricao->setPlaceHolder('Informe uma descrição para o Meta tipo');
$frm->addSwitchField('sit_ativo','Ativo',true);

$frm->setAction( 'Save', 'onSave', $this, null, 'fa:save', 'green' );
$frm->setAction( 'Clear', 'onClear', $this, null, 'fa:eraser', 'red',false );
$this->form = $frm->show();


// define the form actions
//$this->form->addAction( 'Save', new TAction([$this, 'onSave']), 'fa:save green');
$this->form->addActionLink( 'Clear',new TAction([$this, 'onClear']), 'fa:eraser red');

// make id not editable
//$id->setEditable(FALSE);

// create the datagrid
$formDinGrid = new TFormDinGrid($this,'gd','Lista de Meta Tipos','idMetaTipo');
Expand Down

0 comments on commit 13eb372

Please sign in to comment.