⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Bootstrap customer error message fails



Koia

Koia
  • profile picture
  • Member

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;
        }
    }