public function __construct() { parent::__construct(); $this->add(new Panel('employeetable'))->setVisible(true); $this->employeetable->add(new DataView('employeelist', new EDS('\\ZippyERP\\ERP\\Entity\\employee'), $this, 'employeelistOnRow'))->Reload(); $this->employeetable->add(new ClickLink('addnew'))->setClickHandler($this, 'addOnClick'); $this->add(new Form('employeedetail'))->setVisible(false); $this->employeedetail->add(new AutocompleteTextInput('editcontact'))->setAutocompleteHandler($this, "onContact"); $this->employeedetail->add(new SubmitButton('save'))->setClickHandler($this, 'saveOnClick'); $this->employeedetail->add(new Button('cancel'))->setClickHandler($this, 'cancelOnClick'); $this->employeedetail->add(new DropDownChoice('editdepartment', Department::findArray('department_name', '', 'department_name'))); $this->employeedetail->add(new DropDownChoice('editposition', Position::findArray('position_name', '', 'position_name'))); $this->employeedetail->add(new TextInput('editlogin')); $this->employeedetail->add(new ClickLink('opencontact'))->setClickHandler($this, 'OpenOnClick'); $this->employeedetail->add(new ClickLink('showcontact'))->setClickHandler($this, 'ShowOnClick'); $this->employeedetail->add(new ClickLink('addcontact'))->setClickHandler($this, 'AddContactOnClick'); $this->add(new \ZippyERP\ERP\Blocks\Contact('contactdetail', $this, 'OnDetail'))->setVisible(false); $this->add(new \ZippyERP\ERP\Blocks\ContactView('contactview'))->setVisible(false); }
public function deleteOnClick($sender) { Department::delete($sender->owner->getDataItem()->department_id); $this->departmenttable->departmentlist->Reload(); }