Beispiel #1
0
 public function create($values)
 {
     $page = \reasg\ui_views::createDefaultView();
     $recordView = \reasg\ui_template::create("record.view");
     $recordView->set("record_title", "New Employee Record");
     $page->body->write($recordView);
     $ds = \reasg\ui_datasource::createDataset('student_record');
     //Settings items individually
     $ds->items['std_sn'] = '812150001';
     $ds->items['std_name'] = 'Joe Cuevas Garcia';
     $ds->items['std_ssn'] = ['123', '45', '6789'];
     $ds->items['std_dob'] = '09/22/1998';
     $ds->items['std_sex'] = 'm';
     $ds->items['languages'] = ['sp', 'en'];
     //bind this ds to fields in a view with
     //the same name as this ds
     $ds->bindToView();
     //reasg_dev_dump($recordView);
 }
 public function edit($values)
 {
     $page = \reasg\ui_views::createDefaultView();
     $ds = \reasg\ui_datasource::createDataset('employee');
     //Settings items individually
     $ds->items['email'] = 'jose.cuevas';
     $ds->items['emp_name'] = 'Jose';
     $ds->items['emp_mname'] = 'L';
     $ds->items['emp_lname'] = 'Cuevas Garcia';
     $ds->items['emp_state'] = 'pr';
     $ds->items['emp_city'] = 'mc';
     $ds->items['field_enabled'] = '0';
     $ds->items['start_date'] = '09/20/2015';
     $ds->items['field_checkbox01'] = ['1', '2'];
     $ds->items['field_radio01'] = '2';
     //populate a repeater table
     $ds->items['records2'] = [['id' => '001', 'school_name' => 'Vilmari Sanchez', 'town' => 'ri', 'date_created' => '09/20/2015', 'amount' => '18,000'], ['id' => '002', 'school_name' => 'Jose Cuevas', 'town' => 'ag', 'date_created' => '09/21/2015', 'amount' => '18,000'], ['id' => '003', 'school_name' => 'Joe Cuevas', 'town' => 'mc', 'date_created' => '09/22/2015', 'amount' => '18,000']];
     //setting an attribute to a binded field
     $ds->field('field_enabled')->readonly();
     $ds->field('emp_tax_rate')->readonly()->placeholder('FICA NOT REQUIRED');
     $ds->field('email')->decoration("@uprm.edu");
     //bind this ds to fields in a view with
     //the same name as this ds
     $ds->bindToView();
     $f = \reasg\appBundle::create("test", "@assets");
     \reasg\client_controller::importController('employee_controller', $f->js->child('employee.controller.js')->url);
     global $app_controller;
     $ui = $this->controller->client();
     //$ui->showAlertError("This is big alert 2!");
     $a = ['start_date' => '09/27/2015'];
     $ui->populateSelectorWithDataset("employee", $a);
     //$page->js->write("//hello jose");
     //$o = \reasg\client_controller::when("employee.email")->changed()->val('jose.cuevas')->done();
     //reasg_dev_dump($o,'$o');
     //global $app_state;
     //reasg_dev_dump($app_state['current_interaction'], '$app_state');
     $recordView = \reasg\ui_template::create("record.view");
     $recordView->set("record_title", "Employee Record");
     $page->body->write($recordView);
     //reasg_dev_dump($recordView);
 }