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]
  • #121 / Jul 16, 2011 12:10pm

    web-johnny

    235 posts

    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?


    No not yet. I want to write some code of adding your own Tools/Actions in a newer version. It just need time to do it. I just want to do a generic add_tool functionality . Those who create their own, they add some functions to grocery crud.

  • #122 / Jul 16, 2011 12:21pm

    web-johnny

    235 posts

    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:

    function full_example($page = 0)
    {
            $limit = 50; 
            $this->grocery_crud->set_table('customers')
                 ->set_subject('Customer')
                 ->display_as('customerName','Name')
                 ->display_as('contactLastName','Last Name');
     
            $this->grocery_crud->required_fields('customerName','contactLastName');
            $this->grocey_crud->limit($limit,$page*$limit);
            $this->grocery_crud->render();
    }

    but don’t work… i feel the problem is in $page parameter and grocery crud ...

    This only happens on the theme “datatables” . It is a theme that works with the client side datatables. Flexigrid ajax works fine. Here is an example of how fast grocery crud is with 1000 items and more complicated queries such as two multiple relations - http://www.grocerycrud.com/examples/index.php/examples/film_management, . I don’t think it could be faster. If though you think something it is wrong create your own model ( see four posts up from here for how to create your own model and adding it to grocery crud ) - http://ellislab.com/forums/viewreply/914742/ - and share it

  • #123 / Jul 16, 2011 7:11pm

    Snap Shot

    7 posts

    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:

    function full_example($page = 0)
    {
            $limit = 50; 
            $this->grocery_crud->set_table('customers')
                 ->set_subject('Customer')
                 ->display_as('customerName','Name')
                 ->display_as('contactLastName','Last Name');
     
            $this->grocery_crud->required_fields('customerName','contactLastName');
            $this->grocey_crud->limit($limit,$page*$limit);
            $this->grocery_crud->render();
    }

    but don’t work… i feel the problem is in $page parameter and grocery crud ...

    Make sure your indexes are correctly set. If you have any table returning anything from any appreciable number of queries then there will be slow downs. Make sure that customers_id is an int and customerName and contactLastName are in your main index. You should be fine then.

  • #124 / Jul 16, 2011 11:58pm

    fabgonber

    15 posts

    This only happens on the theme “datatables” . It is a theme that works with the client side datatables. Flexigrid ajax works fine. Here is an example of how fast grocery crud is with 1000 items and more complicated queries such as two multiple relations - http://www.grocerycrud.com/examples/index.php/examples/film_management, . I don’t think it could be faster. If though you think something it is wrong create your own model ( see four posts up from here for how to create your own model and adding it to grocery crud ) - http://ellislab.com/forums/viewreply/914742/ - and share it

    I will move from datatables to flexigrid and test…

    With Flexigrid works fine… thanks!

  • #125 / Jul 24, 2011 7:27am

    dodulz

    4 posts

    i have problem with date picker with input datetime ((yyyy-mm-dd) hh:mm).
    grocery input date picker can’t get value.

  • #126 / Jul 24, 2011 5:30pm

    web-johnny

    235 posts

    i have problem with date picker with input datetime ((yyyy-mm-dd) hh:mm).
    grocery input date picker can’t get value.

    I can’t understand what exactly the problem is. If you see the example http://www.grocerycrud.com/examples/index.php/examples/orders_management/edit/10100 you can choose and get value to the datetime picker without problem. Please be more specific or show a printscreen of the problem.

  • #127 / Jul 24, 2011 10:43pm

    dodulz

    4 posts

    on grocerycrud, when I create a table with a datetime data type, then it will generate groocerycrud filed with the datetime format (yy-mm-dd hh:mm).

    the problem arises when I add data. I can not enter data,coz datetime that I choose on datepicker, does not look into the textfield. when I edit data it’s no problem with datepicker.  the problem when I add data.

    so how to fix it?

    Screenshot

  • #128 / Jul 25, 2011 1:34am

    web-johnny

    235 posts

    on grocerycrud, when I create a table with a datetime data type, then it will generate groocerycrud filed with the datetime format (yy-mm-dd hh:mm).

    the problem arises when I add data. I can not enter data,coz datetime that I choose on datepicker, does not look into the textfield. when I edit data it’s no problem with datepicker.  the problem when I add data.

    so how to fix it?

    Screenshot


    UPS 😖 I think you’re right this is a BUG. I will look at it and send you which line to change

  • #129 / Jul 25, 2011 8:44pm

    Philbywhizz

    1 posts

    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 had this same problem.. on my local XAMP machine it was working fine.. but on my production linux server it was failing with the above symptoms..

    Turns out that you have to turn on php’s short-tags (to enable <?=$blah ?>).

    Hopefully that would help other people who experience the same issue 😊

  • #130 / Jul 25, 2011 11:03pm

    Manjunath Reddy

    9 posts

    Is grocery CRUD library 2.0.x is compatible with CI 2.0.2 version.?

  • #131 / Jul 26, 2011 10:23am

    web-johnny

    235 posts

    Is grocery CRUD library 2.0.x is compatible with CI 2.0.2 version.?


    Oh yes it is

  • #132 / Jul 27, 2011 12:22pm

    web-johnny

    235 posts

    on grocerycrud, when I create a table with a datetime data type, then it will generate groocerycrud filed with the datetime format (yy-mm-dd hh:mm).

    the problem arises when I add data. I can not enter data,coz datetime that I choose on datepicker, does not look into the textfield. when I edit data it’s no problem with datepicker.  the problem when I add data.

    so how to fix it?

    Screenshot


    UPS 😖 I think you’re right this is a BUG. I will look at it and send you which line to change

    I found the bug. Go at the file : public/grocery_crud/js/jquery_plugins/jquery.ui.datetime.js and go to the line 203 and replace the function parseTime with the code below:

    function parseTime (obj) {
                        if($(obj).val() != '')
                            var time = ($(obj).val() || $(this).val()).split(" ");
                        else
                            var time = ['00-00-00','00:00:00'];
                        
                        if (time.length < 2) {
                            time = ['00-00-00','00:00:00'];
                        }
                        
                        $('#pickerplug').data('lastdate',time[0]);    //lastdate = time[0];
                        $('#pickerplug').data('lasttime',time[1]);  //lasttime = time[1];                    
                        time = time[1].split(":");                    
                        
                        if (time.length < 2) {
                            time = ['00','00','00'];
                        }
                        
                        var hour    = time[0] || '00';
                        var minute     = time[1] || '00';
                        
                        writeTime(hour,'hour');
                        writeTime(minute,'minute');
    
                        $('#hourSlider').slider('option', 'value', hour);
                        $('#minuteSlider').slider('option', 'value', minute);    
                            
                        var zero_string = "0";
                        
                        if( $('#pickerplug').data('lastdate').charAt(0) != zero_string.charAt(0) )
                        {
                            $('#datepicker').datepicker( 'setDate', 
                                                        $.datepicker.parseDate(
                                                                datepicker_def['dateFormat'], 
                                                                $('#pickerplug').data('lastdate')
                                                        )
                                                    );
                        }
                        else
                        {
                            $('#datepicker').datepicker( 'setDate', 
                                    $.datepicker.parseDate(
                                            datepicker_def['dateFormat'], 
                                            ''
                                    )
                                );
                        }
                    }
  • #133 / Jul 27, 2011 2:54pm

    dodulz

    4 posts

    on grocerycrud, when I create a table with a datetime data type, then it will generate groocerycrud filed with the datetime format (yy-mm-dd hh:mm).

    the problem arises when I add data. I can not enter data,coz datetime that I choose on datepicker, does not look into the textfield. when I edit data it’s no problem with datepicker.  the problem when I add data.

    so how to fix it?

    Screenshot


    UPS 😖 I think you’re right this is a BUG. I will look at it and send you which line to change

    I found the bug. Go at the file : public/grocery_crud/js/jquery_plugins/jquery.ui.datetime.js and go to the line 203 and replace the function parseTime with the code below:

    function parseTime (obj) {
                        if($(obj).val() != '')
                            var time = ($(obj).val() || $(this).val()).split(" ");
                        else
                            var time = ['00-00-00','00:00:00'];
                        
                        if (time.length < 2) {
                            time = ['00-00-00','00:00:00'];
                        }
                        
                        $('#pickerplug').data('lastdate',time[0]);    //lastdate = time[0];
                        $('#pickerplug').data('lasttime',time[1]);  //lasttime = time[1];                    
                        time = time[1].split(":");                    
                        
                        if (time.length < 2) {
                            time = ['00','00','00'];
                        }
                        
                        var hour    = time[0] || '00';
                        var minute     = time[1] || '00';
                        
                        writeTime(hour,'hour');
                        writeTime(minute,'minute');
    
                        $('#hourSlider').slider('option', 'value', hour);
                        $('#minuteSlider').slider('option', 'value', minute);    
                            
                        var zero_string = "0";
                        
                        if( $('#pickerplug').data('lastdate').charAt(0) != zero_string.charAt(0) )
                        {
                            $('#datepicker').datepicker( 'setDate', 
                                                        $.datepicker.parseDate(
                                                                datepicker_def['dateFormat'], 
                                                                $('#pickerplug').data('lastdate')
                                                        )
                                                    );
                        }
                        else
                        {
                            $('#datepicker').datepicker( 'setDate', 
                                    $.datepicker.parseDate(
                                            datepicker_def['dateFormat'], 
                                            ''
                                    )
                                );
                        }
                    }

    it’s work :D
    thank’s to fix bug grocerycrud :D

  • #134 / Jul 31, 2011 1:13pm

    web-johnny

    235 posts

    You’re welcome.
    To the next version it will be already fixed. Actually the jquery plugin that I used it has this bug and I didn’t realize it before.

  • #135 / Aug 08, 2011 6:28am

    David Tran

    2 posts

    Thank you, this library save me a lot of in develop admin backend.

    And I just dont understand the “set_relation_1_n”. Can you explain it for me.

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

ExpressionEngine News!

#eecms, #events, #releases