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

[eluser]cpomalo[/eluser]
hello

i have made some change to work wiyh CI v2.
now it run but a grid with 20 empty rows is displayed and the processing cursor run continously

calling directly the ajax controller show my records

enabling profiler display on flexgrid controler return no query

the document.ready script look like this

Code:
[removed]$(document).ready(function(){$("#flex1").
flexigrid({url: 'http://localhost/index.php/ajax',dataType: 'json',sortname: 'INSCRIPTION_ID',
sortorder: 'asc',usepager: true,useRp: true,width: 'auto',height: 400,rp: 15,rpOptions: [10,15,20,25,40],
pagestat: 'Displaying: {from} to {to} of {total} items.',blockOpacity: 0.5,title: 'Hello',showTableToggleBtn: true,colModel : [
{display: 'Id', name : 'INSCRIPTION_ID', sortable: true, width : 40, align: 'center'},
{display: 'Nom', name : 'NOM', sortable: true, width : 40, align: 'center'},
{display: 'Prénom', name : 'PRENOM', sortable: true, width : 1, align: '1'},
{display: 'Ville', name : 'VILLE', sortable: true, width : 120, align: 'left'},
{display: 'Nationalité', name : 'NATIONALITE', sortable: true, width : 130, align: 'left'},
{display: 'Pays', name : 'PAYS', sortable: true, width : 80, align: 'right'},
{display: 'Début',  width : 80, align: 'right'},{display: 'Fin',  width : 80, align: 'right'},{display: 'Choix 1',  width : 80, align: 'right'},
{display: 'Choix 2',  width : 80, align: 'right'},
{display: 'Choix 3',  width : 80, align: 'right'}],
searchitems : [{display: 'Id', name : 'INSCRIPTION_ID', isdefault: true},
{display: 'Pays', name : 'PAYS'}],
buttons : [{name: 'Delete', bclass : 'delete', onpress : test},
{separator: true},{name: 'Select All', bclass : 'add', onpress : test},
{name: 'DeSelect All', bclass : 'delete', onpress : test},{separator: true}]}); })[removed]

an idea?

thanks
Claude

[eluser]Basketcasesoftware[/eluser]
Is your table set up to what Flexigrid requires? Flexigrid is coded to a certain table structure. It handles it's own queries. That's its main failing.

[eluser]cpomalo[/eluser]
Hello

the sample from
http://flexigrid.eyeviewdesign.com/Flexi..._v0.36.rar
work fine with CI v2.0 with minor change according with the CI documentation
http://ellislab.com/codeigniter/user-gui...e_200.html
Two minor change must be made in ajax_model.php. Calling directly the controler ajax.php show these error. After fixing it, flexigrid sample work fine.

in ajax_model.php: comment or remove line 22
Code:
$this->CI =& get_instance();

change line 35
Code:
$build_querys = $this->CI->flexigrid->build_querys($querys,TRUE);
to
Code:
$build_querys = $this->flexigrid->build_querys($querys,TRUE);

that'all

I have adapted the sample to my own data table but sorting column not work except for the 2 first columns maybe an error somewhere in my modification.


claude

[eluser]ReyPM[/eluser]
Hi every:
I'm trying to use the Flexigrid implementation posted here http://flexigrid.eyeviewdesign.com/index.php with the new CI 2.0.1 and all are almost done but I'm getting this error with the model:
Quote:A PHP Error was encountered
Severity: Notice
Message: Undefined variable: CI
Filename: models/ajax_model.php
Line Number: 19
The code of this file is as follow:
Code:
<?php

if (!defined('BASEPATH'))
   exit('No direct script access allowed');

class Ajax_model extends CI_Model {

   public function __construct() {
      parent::__construct();
      $CI = & get_instance();
   }

   function get_brands() {
      $table_name = "brand";
      $this->db->select('*')->from($table_name);
      $CI->flexigrid->build_query();
      $return['records'] = $this->db->get();
      $this->db->select('count(id) as record_count')->from($table_name);
      $this->CI->flexigrid->build_query(FALSE);
      $record_count = $this->db->get();
      $row = $record_count->row();

      $return['record_count'] = $row->record_count;
      return $return;
   }
}

?>

What's wrong? Cheers and thx in advance

[eluser]coffak[/eluser]
Hi to all

I'm trying to implement the flexigrid, but is not displaying the grid. I have checked the examples and the code, even my ajax controller is returning the data. I'd like to know if any of you have face this problem.. basically the grid is properly created, but the flexigrid is not appearing.. I have compared my code versus the example code and is the same... so if you know the trick, thnks in advance

[eluser]jhepunk[/eluser]
The flexigrid is great, i can save much time.

I already implemented flexigrid in my apps following http://flexigrid.eyeviewdesign.com/ instruction it works great except delete id 1. No errors showing but it can't delete first id of the record.. help do you know why?

[eluser]jhepunk[/eluser]
It solved.
Sorry my mistake

I changed it from.
Code:
if (is_numeric($country_id) && $country_id > 1)

to.
Code:
if (is_numeric($country_id) && $country_id >= 1)

so it can delete id 1 Big Grin

[eluser]Ranjith Siji[/eluser]
A Flexigrid implementation 1.1 with codeigniter 2.1.0 using the latest jquery 1.7.2 is on CI Flexigrid. Thanks to Frederico Carvalho.

[eluser]anthrotech[/eluser]
I can't seem to get the pagination to work. Any ideas what I might be doing wrong.

When I click on the arrows, the loading icon appears and does not navigate to the next or previous pages. Please share the proper settings and code to make this work.




Theme © iAndrew 2016 - Forum software by © MyBB