Welcome Guest, Not a member yet? Register   Sign In
Flexigrid CodeIgniter Implementation
#31

[eluser]N Narayanan[/eluser]
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

[eluser]Armorfist[/eluser]
[quote author="N Narayanan" date="1225290317"]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[/quote]

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

[eluser]N Narayanan[/eluser]
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

[eluser]Armorfist[/eluser]
Try removing the "/index.php/" bit from $config[‘base_url’]:

Code:
$config[‘base_url’]  = “http://localhost/codeigniter/”;
#35

[eluser]N Narayanan[/eluser]
Hi Thank you, It is working now. Do you also have View, Add, Edit functions for the Grid?

Regards
Narayanan
#36

[eluser]zorka[/eluser]
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

[eluser]ArcticZero[/eluser]
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
Code:
$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)
Code:
$valid_fields = array('i.item_number', 'i.item_name', 'quantity', 'revenue', 'percent');

From the Flexigrid controller
Code:
$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. Smile

Thanks!
#38

[eluser]mosos[/eluser]
quick search function wont work @oracle with active record. any solution?
#39

[eluser]RS71[/eluser]
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

[eluser]mosos[/eluser]
[quote author="RS71" date="1228179056"]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.[/quote]

quick fix:

controller\ajax.php line 39

Code:
//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":[]}');




Theme © iAndrew 2016 - Forum software by © MyBB