Jump to content


fredconv

Member Since 05 Sep 2012
Offline Last Active Oct 10 2012 11:43 AM
-----

Topics I've Started

where_in in set_relation()

09 October 2012 - 12:51 PM

Hi

Is there a way to transform something like this :
$crud->set_relation('gf_analystid', 'tbr_people', 'people_name',array('people_profileid' => 'ana'));
into this
$crud->set_relation('gf_analystid', 'tbr_people', 'people_name',array('people_profileid' => 'ana,bus'));

something like a "where_in"  for a set relation ?

thanks

Search filter issue with extra column

02 October 2012 - 11:30 AM

Hi

In my grid from table "projects"
I ve got a project, a code, a priority, and I ve added an extra column "desired actions" that is not in the table "projects"

when i try to make a search on all fields, I got a sql error:
Unknown column 'desired actions' in 'where clause'..
I even tried with a "desired_actions" column name but this doesn't work for me. it seems since this is not a column from the table, it should be excluded from the where clause.

if i search for a specific column, then it works.

Any way to fix or avoid this ?

Thanks

Fred

Search filter issue with extra column

02 October 2012 - 09:03 AM

Hi
Topic recreated in correct thread : http://www.grocerycr...h-extra-column/


Quote here :
In my grid from table "projects"
I ve got a project, a code, a priority, and I ve added an extra column "desired actions" that is not in the table "projects"

when i try to make a search on all fields, I got a sql error:
Unknown column 'desired actions' in 'where clause'..
I even tried with a "desired_actions" column name but this doesn't work for me. it seems since this is not a column from the table, it should be excluded from the where clause.

if i search for a specific column, then it works.

Any way to fix or avoid this ?

Thanks

Fred

EDIT : I post this in the wrong thread, this should have been in the bug/issue thread. but i don t know how to move it sorry ..

Force default, edit or delete state

18 September 2012 - 09:35 AM

Hi

Is it possible to force a grocery render in edit mode by default ?
Currently I m using GC for displaying a SQL VIEW. but since i can edit a SQL view, i want to still have a link in one of the field of the grid to be able to edit one of the table my view is using

for example: i have 3 tables (projects, sub_projects, users) linked together with joins. (1 to n link, projects to sub_projects and sub_projects to users) but since i want some added or calculated fields that are calculated in the database etc...i use a view to display all on big grid with the informations i want.

How can i add an EDIT link on the project name field that would be the same as if i click on a EDIT link from the projects table that i would have rendered if i was not displaying the VIEW grid ?

i was going to try creating a new grocery_crud object refering to the table projects and open it in the edit mode.

and when i push the update or the back to list , the page owould come back to the VIEW grid instead of the Projects grid..

i know it s possible, instead of a view display to use a big table with join rules and set relations, but i was wondering if it s possible to do it that way.

Hope i m clear enough

Thanks

Grocery crud on sql view

17 September 2012 - 11:37 AM

Hi
Not really a question but more something to share:
If i try to use grocery crud on a sql view, i got an error.. after jsut a quick search, i found that since the primary key is needed (for the edit and delete actions) , it s normal that the render crash :) because there was no check on this.

currently i m modified the grocery_crud.php file from
(line 1385)
foreach($data->list as $num_row => $row)
{
   $data->list[$num_row]->edit_url = $data->edit_url.'/'.$row->{$data->primary_key};
    $data->list[$num_row]->delete_url = $data->delete_url.'/'.$row->{$data->primary_key};
					
}

to

foreach($data->list as $num_row => $row)
{
	 if ($data->primary_key){
	 $data->list[$num_row]->edit_url = $data->edit_url.'/'.$row->{$data->primary_key};
	 $data->list[$num_row]->delete_url = $data->delete_url.'/'.$row->{$data->primary_key};
    }
}

and , of course I ve unset operations from the controller since you can t modify view field :)
if anyone has a better solution or something that could be more useful, feel free to post it :)

thanks

fred