Skip to profile content
Yes, it’s a problem. I solved it by creating functions to convert booleans to integers and then using a yes/no dropdown.
Works perfectly with postgreSQL views :smiley:
Thanks Johnny! [cees] I will test this feature, since I have been using views, which have the id field as their “primary key,” always the id field. They have been very useful to me since the setPrimarykey function does not work in views.
This is my table CREATE TABLE IF NOT EXISTS public.encuesta ( encuesta_id integer NOT NULL DEFAULT nextval(‘encuesta_encuesta_id_seq’::regclass), tipo_encuesta_id integer, subtipo_encuesta_id integer, cobertura_id integer, levantamiento_id integer, confianza_error_id integer, tecnica_id int…
Unfortunately I had to go back to my castAs implementation, since when exporting to Excel the boolean fields appear as 1 and 0 :cry:
Thanks I’ve been waiting for this feature for a while. Every update required changing the GC core. I created a function, castAs(), in which I changed booleans to int and fields to dropdown. $crud->fieldType('supervisor','dropdown',['0' => 'No', '1' => 'Si']); $crud->fieldType('encuestador'…
Muchas gracias, amigo!
It was resolved with a view: WITH base AS ( SELECT row_number() OVER (ORDER BY dispersion.fecha_hora) AS id, dispersion.encuesta_id, dispersion.encuestador_id, dispersion.fecha_hora, dispersion.banco_id, dispersion.importe AS transferido, sum(dispersion.importe) OVER (PARTITION BY dispersion…
Johnny: Thank you so much!!!
Johnny Thank you very much. With more than two letters it starts to filter. The problem is again the capital letters. If you start writing with lowercase letters, it doesn’t filter anything.
I use Laravel 12 and postgreSQL, I didn’t find a way to implement it in the controller.
I love this new feature!
Thansk Johnny! I have new version!
GC 3.1.7 $crud->setTable('bancos'); $crud->setSubject('Bancos', 'Bancos'); $crud->setCsrfTokenName('_token'); $crud->setCsrfTokenValue(csrf_token()); $crud->unsetDeleteMultiple(); $output = $crud->render();
It works for me, thanks Johnny!
Excellent Johnny, for now, I made a small adjustment to the model and the states to include a method, “cast”, which converts the boolean to integer and can be used with “Yes”, “No”. :slight_smile:
Sorry Johnny, it was my fault, I just wanted to help someone else with another error that I didn’t report.
Version 2.9.6 -OK Version 2.9.7 -Issues
Johnny, Thank you very much for your work and effort, and HAPPY NEW YEAR!!!
In some cases I use views (my database is postgres) and set the property $crud->setPrimaryKey, only in one case it did not work for me. so check the model and add these lines for testing: if (!$primaryKeyData){ $primaryKeyData = array(‘attname’ => ‘id’); } I make sure that the “primary key” of …
Controller: <?php namespace App\Http\Controllers; use GroceryCrud\Core\GroceryCrud; class CustomersController extends Controller { public function index() { // } private function _getDatabaseConnection() { return [ 'adapter' => [ 'driver'…