Welcome Guest, Not a member yet? Register   Sign In
how can i tell if a library is loaded
#1

[eluser]buckboru[/eluser]
I am trying to use Flexigrid, but keep getting an error
'Call to a member function build_query() on a non-object' on this statement
$this->CI->flexigrid_ci->build_query();

looking at my debug output
Message: Undefined property: Ajax::$flexigrid_ci</p>
seems to be indicating that maybe its not finding my flexigrid library

So is there a way to determine if this is the case?
i have flexigrid lib installed in ci/system/libraries/flexigrid.php

on a side note, is flexigrid still being actively developed, or is there a better option?
#2

[eluser]kurucu[/eluser]
Have you loaded/autoloaded it? Seems an obvious thing to check!
#3

[eluser]buckboru[/eluser]
i believe i have it loaded properly in my config/autoload.php
$autoload['libraries'] = array('database','flexigrid');
#4

[eluser]kurucu[/eluser]
You have flexigrid_ci in your reference, and flexigrid on the filesystem and in your autoload array. Is there a reason why they are different?
#5

[eluser]buckboru[/eluser]
No good reason i guess. I just copied from the example i found.
I removed the _ci from flexigrid_ci and i'm making some progress now.

See thats what happens when you only know enough to be dangerous. Smile

thanks for the help.
#6

[eluser]kurucu[/eluser]
Well, assuming you are depending on CI's load/autoload functionality they would need to be the same unless you have customised the options a bit, so I guessed that was the problem.

Good luck.
#7

[eluser]Myles Wakeham[/eluser]
[quote author="buckboru" date="1253557968"]on a side note, is flexigrid still being actively developed, or is there a better option?[/quote]

'Better option' is a bit subjective so without any guide as to how you measure the quality of an option, you'll get answers that won't be much use to you. As for development, I get the daily digests from the Google groups on the project and it appears to be active. But what I have found in using it extensively in CI is that it really does about as much in a Grid tool as you would hope for. The only thing missing is 'in row editing' which is a wish list item that FlexiGrid developers have wanted to ages. I've used tools that do this sort of thing before in other languages, and its a pandora's box that you might not want to open as it requires a very connected event driven model to be able to react to changes in the rows.

I suspect it really comes down to what you want it to do. We made a strategic decision to use it about a year ago and have been very happy with the results for our purposes. But if you can define your requirements exactly, you'll find it much easier to determine if it is suitable. If active development of it is key for you, either get involved in the development yourself and contribute (it is after all, an open source project), or weigh the importance of that against your needs. From my own experience with it, I haven't found anything in the code so far that was a bug that affected my own projects. Your mileage may vary of course.

Myles
#8

[eluser]buckboru[/eluser]
Thanks for the reply.
I was more curious than anything.
i'm just getting started with all of this(php,codeigniter etc), and don't get to work on it all that much.

I have made some progress from my original ? but i've hit another problem.
given
Code:
$record_count = $this->db->get();
        $row = $record_count->row();
        
        //Get Record Count
        $return['record_count'] = $row->record_count;
    
        //Return all
        return $return;

$row->record_count has a value, but $return['record_count'] shows null when i hit my return statement.

I don't receive an error, until i get back to my controller and then i get undefined property $record_count

Any idea what is wrong here?
#9

[eluser]kurucu[/eluser]
Well, you should be getting an undefined key error, not an undefined property error. So how are you trying to access the value in your controller?
#10

[eluser]buckboru[/eluser]
Code:
if ($this->flexigrid->init_json_build($records['record_count']))
{        
    foreach ($records['records']->result() as $row)
        {
            $record_items[] = array($row->ID,
            $row->ID,
            $row->ISO,
            $row->NAME,
            '<span style=\'color:#ff4400\'>'.addslashes($row->PRINTNAME).'</span>',
            $row->ISO3,
            $row->NUMCODE,
            '<a ><img >config->item('base_url').'public/images/close.png\'></a> '
            );
            $this->flexigrid->json_add_item($record_item);
        }
        $this->flexigrid->json_add_item();
        //Print please
        $this->output->set_output($this->flexigrid->json_build($records['record_count'],$record_items));




Theme © iAndrew 2016 - Forum software by © MyBB