Jump to content


Bootstrap customer error message fails

bootstrap error message

  • Please log in to reply
No replies to this topic

#1 Koia

Koia

    Member

  • Members
  • PipPip
  • 10 posts

Posted 19 March 2017 - 01:15 AM

Error message is not displayed in Bootstrap theme list view but works fine both in flexgrid and in datatables themes, see test code:
  
public function employees() {
        $crud = new grocery_CRUD();
        $crud->set_theme('bootstrap');
        $crud->set_table('employees');
        $crud->callback_before_delete(array($this, 'check_before_delete'));
        $crud->set_lang_string('delete_error_message', 'This data row with firstName "Karl" cannot be deleted.');
        $output = $crud->render();
        $this->_example_output($output);
    }
 
    function check_before_delete($primary_key) {
        $this->db->select('firstName');
        $query = $this->db->get_where('employees', array('employeeNumber' => $primary_key));
        $row = $query->result_array()[0];
        if ($row['firstName'] == 'Karl') {
            return FALSE;
        } else {
            return TRUE;
        }
    }

 







Also tagged with one or more of these keywords: bootstrap, error message

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users