Esempio n. 1
0
 protected function createComponentCreditAddForm()
 {
     $object = 'creditAdd.';
     $form = new \App\Components\AngularForm($object . 'form', $object . 'credit');
     $form->class = 'wide';
     $form->init = $object . 'init(user)';
     $form->addField('number', 'amount', 'Částka')->setAttribute('min', 1)->setAttribute('step', 0.01)->setValidation('required', 'Musíte uvést částku')->setValidation('number', 'Zadejte číslo větší než nula')->setAddons(NULL, 'Kč');
     $form->addField('text', 'note', 'Poznámka');
     $form->addButton('save', 'Zadat', $object . 'save() && $hide()', 'success');
     return $form;
 }
Esempio n. 2
0
 protected function createComponentChartControlForm()
 {
     $object = 'chartControl.';
     $form = new \App\Components\AngularForm($object . 'form', $object . 'chart');
     $form->addField('select', 'data', 'Zobrazit', 'údaje...')->setAttribute('bs-select')->setAttribute('ng-options', 'item.value as item.label for item in chartControl.data');
     $form->addField('select', 'series', 'podle', 'srovnání...')->setAttribute('bs-select')->setAttribute('ng-options', 'item.value as item.label for item in chartControl.series');
     $form->addField('text', 'dateBegin', 'od', 'nevidím')->setAttribute('bs-datepicker')->setAttribute('size', 6);
     $form->addField('text', 'dateEnd', 'do', 'nevidím')->setAttribute('bs-datepicker')->setAttribute('size', 6);
     $form->addButton('button', 'Vykresli', $object . 'load()', 'success');
     return $form;
 }