v 1.3.3 grocery CRUD - an automatic Codeigniter CRUD |
[eluser]web-johnny[/eluser]
[quote author="javidhb" date="1308940731"]hi, web-johnny I have a mysterious problem!!! Grocery CRUD doesn't show the data in my table. all the DB's configs are ok, and when I use a table-name that doesn't exist in my db it shows FATAL error! but when i use a existing table-name, it doesn't show the data ONLY the bottom menu of the grocery CRUD. and I used your examples, and I followed every thing correctly but still have the problem. I really am sorry for me being newbie! is there any way to help me, please? I must say it again that i do every thing right(I've checked it many times). I really don't know where is the problem! tnks[/quote] Hello there. Please be more specific. For example can you attach an image to show me, what it appears to your project when you add an existing table? Did you try it from the scratch or to an already having project? If you try it from the scratch is really easy to install this codeigniter CRUD. You have tried the examples with my tables (test_database.sql) for the beginning? I just can't unserstand what the problem is to help you.
[eluser]javidhb[/eluser]
Hello back, I am really really sorry for my stupid post. I was trying the Grocery CRUD with a project which already has had a database. but i did what u said(i tried a new project with 'test_database.sql') and everything is working now! I'm going to delete the G. Crud files in my old project and start every thing again. I'm sure it will work this time, I must did sth wrong. By the way, you did a fantastic job, thanks for this useful tool.
[eluser]web-johnny[/eluser]
That's ok javidhb ;-) , there is not a stupid post. Sometime something is in front of our eyes and we don't see it. Glad to help.
[eluser]Snap Shot[/eluser]
Fantastic tool! I've knocked up a prototype app in a few hours that would normally have taken me a few days. I'm new to Codeigniter but this is a great introduction. I do have two requests, when setting $crud->set_relation_1_n I'd like to be able to set a criteria. Such as, using your example; Code: $crud = new grocery_CRUD(); If I want to only assign actors that haven't been assigned to other films. Would it be a good idea to allow; Code: $crud->set_relation_1_n('actors', 'film_actor', 'actor', 'film_id', 'actor_id', 'fullname','priority', ('Where actor_id not in (select actor_id from film_actor);'); I'm sure you could shortcut it to something like Code: $crud->set_relation_1_n('actors', 'film_actor', 'actor', 'film_id', 'actor_id', 'fullname','priority', in_use = true); I know I can probably do something like this in the model, I just haven't figured out how yet :-) Second request is to be able to add more commands to the flexigrid, so along with edit and delete, it'd be nice to be able to add our own "duplicate" or custom commands pointing to another controller with the current row record id. How far away from another release are you? Thanks for the sterling work so far!!!
[eluser]Snap Shot[/eluser]
I've been looking at grocery_model.php and I think that what I'm trying to achieve can be done by reworking get_relation_1_n_unselected_array. In order to get just the rows that aren't already assigned, we need to exclude those that aren't in the relation_table. I think an array unset after the generation of $results_array from get_relation_1_n_unselected_array might be an option. Or alternatively if we could do a db->get_where with a != being the records in relation_table. Something along the lines of: Code: $this->db->where_in($field_info->primary_key_alias_to_selection_table , 'select just the unassigned records and the records this id owns');
[eluser]Snap Shot[/eluser]
I've added: Code: $this->db->where_not_in($field_info->primary_key_alias_to_selection_table , 'select '.$field_info->primary_key_alias_to_selection_table.' from '.$field_info->relation_table); But it's not returning the correct results :-(
[eluser]Snap Shot[/eluser]
I've accomplished what I wanted to by using the following cludge to get_relation_1_n_unselected_array in grocery_model.php: Code: echo $this->uri->segment(1, 0);
[eluser]web-johnny[/eluser]
[quote author="Snap Shot" date="1310586487"]I've accomplished what I wanted to by using the following cludge to get_relation_1_n_unselected_array in grocery_model.php: Code: echo $this->uri->segment(1, 0); Hello @Snap Shot I have an example at http://www.grocerycrud.com/crud/function_name/set_model
[eluser]Snap Shot[/eluser]
That's just excellent! I reset the grocerycrud code to the base install, created the new model. Added the model call to the controller. Works like a charm! That's just super. To pose another question; any chance we're currently able to add custom commands to the flexigrid? I can see other people on the net are able to do it manually, I'm wondering if you've already put a hook into it for us?
[eluser]fabgonber[/eluser]
Grocery Crud is slow with a lot of data (900 records) ... When the table has a lot of rows, grocery do a big select and next paginate the result. This big select it's slow... Ideas? anyone has a example with external pagination (not grocery ajax pagination) and limit with offset? i would like do: Code: function full_example($page = 0) |
Welcome Guest, Not a member yet? Register Sign In |