I have a simple validation:
$crud->setRule('type', 'in', array('P', 'S'));
$output = $crud->render();
if ($output->isJSONResponse) {
header('Content-Type: application/json; charset=utf-8');
echo $output->output;
exit;
}
$css_files = $output->css_files;
$js_files = $output->js_files;
$output = $output->output;
...
When the validation failed, here is what I got:
(see the attachment)
The xdebug was ON, but it was not the issue. At the end of the response was this message:
{"status":"error","errors":{"type":["Type contains invalid value"]}}
which should be displayed somehow instead of the "Something went wrong!" popup.
Please help. Thank you.