ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

v 1.3.3 grocery CRUD - an automatic Codeigniter CRUD

April 11, 2011 3:24am

Subscribe [77]
  • #256 / Jan 03, 2012 5:30pm

    MatthewSchenker

    58 posts

    Greetings Everyone,
    My first post here.  I’ve been quietly spending many hours reading (and re-reading) the entire CI Users Guide.  Also, been reading through the forum.

    I’m about to begin building my first CodeIgniter application. Grocery CRUD looks like it will be part of that!  I’ve already posted at the Grocery CRUD forum, and web-johnny has been very helpful.

    OK, my question…

    Would it be possible for people to post links to their sites built using Grocery CRUD?  If this has already happened, could someone kindly point me in the right direction?

    Looking forward to my CodeIgniter work.

    Thanks,
    Matthew

  • #257 / Jan 03, 2012 6:14pm

    web-johnny

    235 posts

    Greetings Everyone,
    My first post here.  I’ve been quietly spending many hours reading (and re-reading) the entire CI Users Guide.  Also, been reading through the forum.

    I’m about to begin building my first CodeIgniter application. Grocery CRUD looks like it will be part of that!  I’ve already posted at the Grocery CRUD forum, and web-johnny has been very helpful.

    OK, my question…

    Would it be possible for people to post links to their sites built using Grocery CRUD?  If this has already happened, could someone kindly point me in the right direction?

    Looking forward to my CodeIgniter work.

    Thanks,
    Matthew

    Hello Matthew and thank you for your good words of you.

    I think that you are looking something like this: https://github.com/goFrendiAsgard/Neo-CMS . NEO-CMS is a good example to see grocery CRUD at an open-source code. The most people actually that use grocery CRUD they have close-source production projects and I don’t know if you find many projects like that.

  • #258 / Jan 05, 2012 12:09pm

    aaries

    2 posts

    Hi, web-jhonny

    looks is that I have this code,

    function cliente()
            {
                            $crud = new grocery_CRUD();
       $crud->set_theme('flexigrid');
       $crud->set_table('cliente');
       $crud->set_subject('Cliente');
                            $crud->required_fields('nombre','rut');
                            $crud->set_rules('nombre','Nombre','callback_nombre_check');
                            //$crud->set_rules('rut','Rut','callback_validarRut');
                            $crud->callback_column('Accion',array($this,'goSucursal'));
                            $crud->columns('nombre','rut','Accion');
                            $crud->fields('nombre','rut');
       $output = $crud->render();
    
       $this->_example_output($output);
            }

    with this funcion of validation

    function nombre_check($str)
            {
                if( $str== 'test')
                {
                    $this->form_validation->set_message('nombre_check', $str.' no es un nombre valido');
                    return FALSE;
                }
                else
                {
                    return TRUE;
                }
                return $str;
            }

    but the message doesn’t appears, on the contrary appears this message “Unable to access an error message corresponding to your field name.”

    Help me Please!!

    regards!

  • #259 / Jan 06, 2012 12:01am

    aaries

    2 posts

    I fix the problem, but that code don’t recognize de error required fields, in case i try to save a blank item.

    where or what i could change the language a required fields of grocery?

    help plz

  • #260 / Jan 06, 2012 5:19pm

    web-johnny

    235 posts

    An express version is released version 1.1.7 with some BUG fixes, adding some languages with the help of the community.

    Beside this Grocery CRUD is now released with dual licensing, using the GPL v3 and the MIT license. For more read grocery CRUD licence.

  • #261 / Jan 10, 2012 12:00pm

    MatthewSchenker

    58 posts

    Greetings web-johnny,
    I’ve been spending the past few days getting even more information on CodeIgniter and Grocery CRUD.

    Almost everything about Grocery CRUD makes sense to me.  Setting up forms and tables looks great!  I believe I’ve figured out how to use an authorization system with it.

    The one area I’m still stuck on is how to use data collected from Grocery CRUD in my CodeIgniter views (placing it into layouts with my own CSS classes).

    For example, I’m building a real-estate site.  Tables are great for the admin to deal with the data.  But what’s the best method for pulling that data from Grocery CRUD to create property listings?  Is this where I just use basic CodeIgniter functions?

    I’m still getting up to speed on CodeIgniter, so my question may be embarrassing to me a month from now!

    Thanks for all your great work,
    Matthew

  • #262 / Jan 10, 2012 12:11pm

    yepwingtim

    3 posts

    Hi Johnny,

    I’m trying to use the set_model function. I am very new to GroceryCrud.  Is there any examples how to use this?

    I have 3 tables.

    Demographics
    demo_id (prim)
    name
    location_id

    Location
    location_id (prim)
    location_name

    Visits
    visits_id
    demo_id
    location_id

    I want the visits table to show.  The person that made the visit.  The Location name which the person is from.  I needed the Demographics field: Location to be filtered by the where clause.  This ultimately made me think of using the set_model.

    $crud->where cannot be done cause it only goes by the primary table which is the VISITS table in this case.

    so something like

    SELECT * FROM visits
    INNER JOIN demographics ON visits.demo_id = demographics.demo_id WHERE demographics.location_id=$location

    http://www.grocerycrud.com/crud/function_name/set_model—isn’t very helpful.

    Is that function get_relation_n_n_unselected_array automatically called?

    Do I have to use set_table in my controller?  If I don’t use it, I get an error.

    Error Number: 1064

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘’ at line 1

    SHOW COLUMNS FROM

    Filename: C:\xampp\htdocs\ci3\system\database\DB_driver.php

    Line Number: 330

    Thanks~

  • #263 / Jan 12, 2012 2:57pm

    web-johnny

    235 posts

    Hi Johnny,

    I’m trying to use the set_model function. I am very new to GroceryCrud.  Is there any examples how to use this?

    I have 3 tables.

    Demographics
    demo_id (prim)
    name
    location_id

    Location
    location_id (prim)
    location_name

    Visits
    visits_id
    demo_id
    location_id

    I want the visits table to show.  The person that made the visit.  The Location name which the person is from.  I needed the Demographics field: Location to be filtered by the where clause.  This ultimately made me think of using the set_model.

    $crud->where cannot be done cause it only goes by the primary table which is the VISITS table in this case.

    so something like

    SELECT * FROM visits
    INNER JOIN demographics ON visits.demo_id = demographics.demo_id WHERE demographics.location_id=$location

    http://www.grocerycrud.com/crud/function_name/set_model—isn’t very helpful.

    Is that function get_relation_n_n_unselected_array automatically called?

    Do I have to use set_table in my controller?  If I don’t use it, I get an error.

    Error Number: 1064

    You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘’ at line 1

    SHOW COLUMNS FROM

    Filename: C:\xampp\htdocs\ci3\system\database\DB_driver.php

    Line Number: 330

    Thanks~

    The set_table is required to use grocery_CRUD, though you can add you own query with grocery CRUD set_model. The list is showing at: get_list function (see line 18 grocery_Model). I suggest that first to work with grocery_CRUD and be familiar with it, work with set_relation_n_n function and then try to use set_model. If you are not familiar with the functionality of grocery_CRUD perhaps will make you confuse to use the set_model.

  • #264 / Jan 12, 2012 3:01pm

    web-johnny

    235 posts

    Greetings web-johnny,
    I’ve been spending the past few days getting even more information on CodeIgniter and Grocery CRUD.

    Almost everything about Grocery CRUD makes sense to me.  Setting up forms and tables looks great!  I believe I’ve figured out how to use an authorization system with it.

    The one area I’m still stuck on is how to use data collected from Grocery CRUD in my CodeIgniter views (placing it into layouts with my own CSS classes).

    For example, I’m building a real-estate site.  Tables are great for the admin to deal with the data.  But what’s the best method for pulling that data from Grocery CRUD to create property listings?  Is this where I just use basic CodeIgniter functions?

    I’m still getting up to speed on CodeIgniter, so my question may be embarrassing to me a month from now!

    Thanks for all your great work,
    Matthew

    Hello Matthew I just see your post by answering another :cheese: . The answer is the basic Codeigniter functions. There is no such a thing to retrieve data from grocery_CRUD.

  • #265 / Jan 13, 2012 6:20am

    MatthewSchenker

    58 posts

    web-johnny,
    Yes, I finally got it!  Looking at the Active Record documentation again, after learning about Grocery CRUD, made it all click finally.

    For me, this is a shift in thinking. I’ve worked in Joomla for the past three years.  In Joomla, each “extension” creates its own little area for creating and pulling data, and data from that extension must be handled by functions only within that same extension.

    I’m happily getting accustomed to the idea in CodeIgniter that data created in one place is freely accessible everywhere in your application!

    Thank you again for your terrific CRUD extension, and your friendly help.

    Matthew

  • #266 / Jan 25, 2012 2:23pm

    skergetd

    2 posts

    Hello, first of all: Great WORK! Thanks…

    I have a little question. I have a relation like this…

    $crud = new grocery_CRUD();
    $crud->set_table('offer');
    $crud->set_relation('coun_ID','country','coun_title');

    And now when user wants to add na offer, he selects a country from a dropdown. But what if there is no country that he would like to select? Then he has to add it…
    Could i somehow create a button ADD next to dropdown? Or maybe a field in a dropdown that says ADD RECORD? I have been looking everywhere for that, but found nothing.

    callback_field

    could kinda do what I want, but if I use it, I can get my button at the end of field, but then there is no dropdown.

    Thanks if you could help

  • #267 / Jan 28, 2012 6:13am

    web-johnny

    235 posts

    Hello, first of all: Great WORK! Thanks…

    I have a little question. I have a relation like this…

    $crud = new grocery_CRUD();
    $crud->set_table('offer');
    $crud->set_relation('coun_ID','country','coun_title');

    And now when user wants to add na offer, he selects a country from a dropdown. But what if there is no country that he would like to select? Then he has to add it…
    Could i somehow create a button ADD next to dropdown? Or maybe a field in a dropdown that says ADD RECORD? I have been looking everywhere for that, but found nothing.

    callback_field

    could kinda do what I want, but if I use it, I can get my button at the end of field, but then there is no dropdown.

    Thanks if you could help

    Hello @skergetd,

    Actually there are some persons that create an add button at the right of the drop-down list but there is not anywhere as an extension or a sharing code.

    Till now it is not available to do something like that so you have to change the library and probably some views to do it.

    You can have a try and see how it goes and for any questions or any stack you can post a question to this forum or to the grocery CRUD forum.

  • #268 / Jan 28, 2012 10:43am

    InsiteFX

    6819 posts

    @web-johnny

    I will have some free time this week and I will see if I can add it.
    I’ll put the source here for download when I get it to work.

  • #269 / Jan 28, 2012 10:51am

    web-johnny

    235 posts

    @web-johnny

    I will have some free time this week and I will see if I can add it.
    I’ll put the source here for download when I get it to work.

    For extra coding it will be better to add it at the forums of grocery CRUD at the forum extra coding/plugins (http://www.grocerycrud.com/forums/forum/8-extra-coding-plugins/) if you don’t mind of course. I also write a topic of how to create an extension for grocery CRUD it is a small topic but I will add some more content time to time.

    Thanks @InsiteFX

  • #270 / Jan 31, 2012 12:02pm

    fdias

    2 posts

    I’ve been using Grocery Crud for the past couple of months and have to say it’s amazing. The developer did a great job and it not only does the job well but also looks great visually.

    Thanks a lot for your hard work!

    Let me know if I can help.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases