Welcome Guest, Not a member yet? Register   Sign In
problem with loading flexigrid library
#1

[eluser]bhakti.thakkar[/eluser]
hello,
i want to load data of a table in a flexigrid. but i am facing problem in loading the grid. it just displays me headers of the table with "Processing, please wait ..." below the grid.
no images of the button gets loaded. no errors as well. but i was just trying to trace whether it was querying the table. but record count is also not fetched. there is some problem in the model i feel

Relation_Model.php
Code:
<?php
class relations_model extends Model {

    function relations_model()
    {
        parent::Model();
        $this->obj =& get_instance();

    }


     function get_relations_flex()
    {
        //Select table name
        $table_name = "Relation_T";
        
        //Build contents query
        $this->db->select('Relation_ID,Name_VC,Address_VC,PostalCode_VC,City_VC,Country_ID')->from($table_name);
        $this->flexigrid->build_query();

        //Get contents
        $return['records'] = $this->db->get();

        //Build count query
        $this->db->select('count(id) as record_count')->from($table_name);
        $this->flexigrid->build_query(FALSE);
        $record_count = $this->db->get();
        $row = $record_count->row();
        
        //Get Record Count
        $return['record_count'] = $row->record_count;
    
        //Return all
        return $return;
    }
}

i think the flexigrid library isnt getting loaded. but if i try to put $this->load->library('flexigrid');
it gives me the error or redeclaration. can anyone please help me on this



thanks in advance
#2

[eluser]bhakti.thakkar[/eluser]
i tried to use a simple table of country to make it work. Now atleast my flexigrid gets loaded but still with no data in it. it just comes processing, please wait.... what could be possible mistake?? there are 237 rows.
in ajax.php controller
Code:
foreach ($records['records']->result() as $row)
        {
            $record_items[] = array($row->Country_ID,
            $row->Country_ID,
            $row->Country_VC,
            '<a ><img >config->item('base_url').'public/images/close.png\'></a> '

            );
        }




Theme © iAndrew 2016 - Forum software by © MyBB