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.

Flexigrid CodeIgniter Implementation

September 05, 2008 4:07pm

Subscribe [63]
  • #31 / Oct 29, 2008 6:25am

    N Narayanan

    8 posts

    Hi,

    First of all thanks very much for this implementation. I have tried to run this however I am getting the following error

    Fatal error: Call to undefined function site_url() in D:\xampp\htdocs\CodeIgniter\system\application\controllers\flexigrid.php on line 58

    Can some one help me?

    Regards
    Narayanan

  • #32 / Oct 29, 2008 7:04am

    Armorfist

    121 posts

    Hi,

    First of all thanks very much for this implementation. I have tried to run this however I am getting the following error

    Fatal error: Call to undefined function site_url() in D:\xampp\htdocs\CodeIgniter\system\application\controllers\flexigrid.php on line 58

    Can some one help me?

    Regards
    Narayanan

    Hello Narayanan,

    You have to autoload the url helper. To do that, open application/config/autoload.php and add ‘url’ to the $autoload[‘helper’] array.

  • #33 / Oct 29, 2008 9:02am

    N Narayanan

    8 posts

    I do have this in my autoload.php, the below is the content I have in my autoload.php

    $autoload[‘helper’] = array(‘array’, ‘url’, ‘form’);

    I realized that I have not updated the base url in the config.php. Now I have added the following

    $config[‘base_url’]  = “http://localhost/codeigniter/index.php/”;

    Now I am getting the About Page, but when I clicked the Demo menu, nothing is happening and I see it is going to the url

    http://localhost/codeigniter/index.php/flexigrid/index

    Is there anything else I am missing?

    Regards
    Narayanan

  • #34 / Oct 29, 2008 9:24am

    Armorfist

    121 posts

    Try removing the “/index.php/” bit from $config[‘base_url’]:

    $config[‘base_url’]  = “http://localhost/codeigniter/”;
  • #35 / Nov 02, 2008 12:23am

    N Narayanan

    8 posts

    Hi Thank you, It is working now. Do you also have View, Add, Edit functions for the Grid?

    Regards
    Narayanan

  • #36 / Nov 09, 2008 2:21am

    zorka

    5 posts

    Hello all,

    Maybe this is a dumb question, but what’s the correct way to deal with an empty set? In the example, there is a function getCountries, which populates the grid with countries from the database… WHAT if that database was empty?

    I tried this and it seems the flexigrid just keeps processing (it says processing and turns and turns)...

    1. Is there a way to show an empty grid (show the headers but no items)?
    2. Is there a way to force the grid to a minimized state (and force it to stay closed) if its empty?

    ThanX

  • #37 / Nov 19, 2008 2:21am

    ArcticZero

    14 posts

    Hi, I’ve been having a problem with Flexigrid on CI on my current project. I use a select query with a subquery, and for some reason I cannot sort my data by the last two columns.

    From ajax_model.php

    $this->db->select("i.item_number, i.item_name, SUM(si.quantity_purchased) AS quantity, SUM(si.item_total_cost) AS revenue, SUM(si.item_total_cost) / (SELECT SUM(total_sales) AS sum FROM submissions WHERE date_submitted = '" . $date . "') AS percent", false);
            $this->db->where("s.date = '" . $date . "' AND s.id = si.sale_id AND si.item_id = i.id", null, false);
            $this->db->group_by("i.item_name", false);
            $this->db->from("items i, sales s, sales_items si", false);

    From ajax.php (controller)

    $valid_fields = array('i.item_number', 'i.item_name', 'quantity', 'revenue', 'percent');

    From the Flexigrid controller

    $colModel['i.item_number'] = array('SKU/Barcode', 150, TRUE, 'left', 2);
                $colModel['i.item_name'] = array('Name', 250, TRUE, 'left', 1);
                $colModel['quantity'] = array('Sold', 50, TRUE, 'center', 0);
                $colModel['revenue'] = array('Revenue', 160, TRUE, 'right', 0);
                $colModel['percent'] = array('% of Gross', 75, TRUE, 'center', 0);

    The grid is perfectly sortable by item number, name, and quantity. However whenever I try to sort it by revenue or percent, it gets stuck refreshing, with the “Processing, please wait…” message. Hope this can be resolved, since I really love using this implementation. Saved hours generating tables. 😊

    Thanks!

  • #38 / Dec 01, 2008 5:20am

    mosos

    4 posts

    quick search function wont work @oracle with active record. any solution?

  • #39 / Dec 01, 2008 2:50pm

    RS71

    106 posts

    I’m searching for things that return no result and it keeps doing the ‘Processing, please wait…’ . Is there a way to make it say that there are no results instead of saying processing infinitely?

    Also, it seems that you can’t search anymore until you reload the page. It gets stuck on the infinite processing.

    Edit: Actually, you’re not able to do anything after it gets stuck.

  • #40 / Dec 02, 2008 11:43am

    mosos

    4 posts

    I’m searching for things that return no result and it keeps doing the ‘Processing, please wait…’ . Is there a way to make it say that there are no results instead of saying processing infinitely?

    Also, it seems that you can’t search anymore until you reload the page. It gets stuck on the infinite processing.

    Edit: Actually, you’re not able to do anything after it gets stuck.

    quick fix:

    controller\ajax.php line 39

    //Print please
            if (isset($record_items))
                $this->output->set_output($this->flexigrid->json_build($records['record_count'],$record_items));
            else
                $this->output->set_output('{"page":"1","total":"0","rows":[]}');
  • #41 / Dec 02, 2008 4:13pm

    RS71

    106 posts

    I’m searching for things that return no result and it keeps doing the ‘Processing, please wait…’ . Is there a way to make it say that there are no results instead of saying processing infinitely?

    Also, it seems that you can’t search anymore until you reload the page. It gets stuck on the infinite processing.

    Edit: Actually, you’re not able to do anything after it gets stuck.

    quick fix:

    controller\ajax.php line 39

    //Print please
            if (isset($record_items))
                $this->output->set_output($this->flexigrid->json_build($records['record_count'],$record_items));
            else
                $this->output->set_output('{"page":"1","total":"0","rows":[]}');

    Very nice! Thank you Mosos.

  • #42 / Dec 02, 2008 6:32pm

    vicman

    22 posts

    greath job.

    thanks 😊

  • #43 / Dec 20, 2008 10:04pm

    mosos

    4 posts

    use this library with multiple database connection and found that build_query function is hardcoded to use default db connection. how to fix this ?

  • #44 / Jan 16, 2009 3:27pm

    Eric Dykstra

    3 posts

    I’m searching for things that return no result and it keeps doing the ‘Processing, please wait…’ . Is there a way to make it say that there are no results instead of saying processing infinitely?

    Also, it seems that you can’t search anymore until you reload the page. It gets stuck on the infinite processing.

    Edit: Actually, you’re not able to do anything after it gets stuck.

    quick fix:

    controller\ajax.php line 39

    //Print please
            if (isset($record_items))
                $this->output->set_output($this->flexigrid->json_build($records['record_count'],$record_items));
            else
                $this->output->set_output('{"page":"1","total":"0","rows":[]}');

    Very nice! Thank you Mosos.

    I have the same issue - but the ‘quick fix’ made no difference. Something I’ve done wrong?

  • #45 / Jan 16, 2009 5:46pm

    Eric Dykstra

    3 posts

    I’m searching for things that return no result and it keeps doing the ‘Processing, please wait…’ . Is there a way to make it say that there are no results instead of saying processing infinitely?

    Also, it seems that you can’t search anymore until you reload the page. It gets stuck on the infinite processing.

    Edit: Actually, you’re not able to do anything after it gets stuck.

    quick fix:

    controller\ajax.php line 39

    //Print please
            if (isset($record_items))
                $this->output->set_output($this->flexigrid->json_build($records['record_count'],$record_items));
            else
                $this->output->set_output('{"page":"1","total":"0","rows":[]}');

    Very nice! Thank you Mosos.

    I have the same issue - but the ‘quick fix’ made no difference. Something I’ve done wrong?

    I should add ... I used the Console in FireBug to find this:

    A PHP Error was encountered

    Severity: Notice
    Message:  Undefined property:  Ajax_model::$db
    Filename: models/ajax_model.php
    Line Number: 31

    </div>

    Fatal error:  Call to a member function select() on a non-object in /var/www/domain_name_removed/html
    /system/flexigrid/models/ajax_model.php
    on line 31


    From that it appears the ‘db’ object has not been instantiated but this is an example code set, so I am sure it has.

    Ideas?

    Thanks in advance.

    Eric

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

ExpressionEngine News!

#eecms, #events, #releases