/** * method onDelete() * executed whenever the user clicks at the delete button * Ask if the user really wants to delete the record */ function onDelete($param) { // define the delete action $action = new TAction(array($this, 'Delete')); $action->setParameters($param); // pass the key parameter ahead // shows a dialog to the user new TQuestion(TAdiantiCoreTranslator::translate('Do you really want to delete ?'), $action); }
/** * method deleteCollection() * Delete many records */ public function deleteCollection($param) { // decode json with record id's $selected = json_decode($param['selected']); try { TTransaction::open($this->database); if ($selected) { // delete each record from collection foreach ($selected as $id) { $class = $this->activeRecord; $object = new $class(); $object->delete($id); } $posAction = new TAction(array($this, 'onReload')); $posAction->setParameters($param); new TMessage('info', AdiantiCoreTranslator::translate('Records deleted'), $posAction); } TTransaction::close(); } catch (Exception $e) { new TMessage('error', $e->getMessage()); TTransaction::rollback(); } }
/** * method onDelete() * executada quando o usuario clica no botao delete * Ask if the user really wants to delete the record */ function onDelete($param) { // define the delete action $action = new TAction(array($this, 'Delete')); $action->setParameters($param); // pass the key parameter ahead // mostra o dialogo para o usuario new TQuestion('Deseja realmente excluir ?', $action); }
/** * method onDelete() * executed whenever the user clicks at the delete button * Ask if the user really wants to delete the record */ function onDelete($param) { // define the delete action $action = new TAction(array($this, 'Delete')); $action->setParameters($param); // pass the key parameter ahead // shows a dialog to the user new TQuestion('Deseja realmente excluir ?', $action); }