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]
  • #61 / Jan 05, 2010 5:32pm

    mjsilva

    45 posts

    Hei guys,

    Just finish tunning up flexigrid to meet my needs and want to share with you.

    I needed that flexigrid “remembers” the column width, search filters and page, so I decided to dig in the code and make it happen.

    I used the Jason Valdron implementation witch already had column width to cookie after seeing his implementation it was more easy to make mine.

    Here is the final code: http://pastebin.com/f66c1d534

    So if you set cookies to true in parameters (is true by default) flexigrid should be save state after leaving the page, and should remain the same when u get back.

    Test it and let me know if it works for you.

    EDIT: You need to use http://plugins.jquery.com/project/cookie

  • #62 / Jan 06, 2010 6:35am

    mjsilva

    45 posts

    Changed one line of code witch makes the clear button to clear page cookie: http://pastebin.com/f2159ccf7

  • #63 / Jan 13, 2010 2:02pm

    langithitam

    13 posts

    Hy mate,

    Is there someone out there have implement add data function & make the grid editable?
    I really appreciate it if wanna share it.

    Thx,
    Boby

  • #64 / Jan 13, 2010 2:07pm

    langithitam

    13 posts

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

    Regards
    Narayanan

    @N Narayanan did found solution for u’r problem, mate? I think i need it also..

  • #65 / Jan 19, 2010 2:49am

    zacklander2007

    2 posts

    RS71 - 01 December 2008 12:50 PM

      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":[]}’);

    good working man, thanks Alot!!

  • #66 / Jan 28, 2010 4:13pm

    groyk

    25 posts

    Starting with flexigrid

    Hi CI Experts

    I’ve just downloaded and tested flexigrid for CI.

    But no data is loaded.

    When I try to load “http://MyUrl/index.php/ajax” i get following error

    A PHP Error was encountered

    Severity: Notice

    Message: Undefined property: Ajax_model::$db

    Filename: models/ajax_model.php

    Line Number: 31

    Fatal error: Call to a member function select() on a non-object in C:\wamp\www\flexi\app\models\ajax_model.php on line 31

  • #67 / Jan 29, 2010 3:02pm

    groyk

    25 posts

    Figured it out!

    Forgot to autoload database

  • #68 / Apr 12, 2010 1:04pm

    aibanez

    4 posts

    I’m trying to test the Flexigrid in my WAMP machine but I can’t.
    After downloading the example, I’ve created the database and the table (countries) I put all the parameters on database.php to connect with my DB, I put con config.php the necesary changes (base_url), I’ve modified the autoload.php with the autoload database and autoload URL helper, I’ve modified the routes.php with default_controler (flexigrid) but when I point my browser to flexigrid installation the page appears with errors (example: the links on the top (Demo, Doumentaion, Download appears >Demo, >Documentation, Download) and when I clicked on Demo the browser tell me page Forbidden and the link generated is
    “http://localhost/grid/<?=site_url(”

    What I’m doing wrong??

    Please help!

    THX in advance

  • #69 / Apr 12, 2010 6:59pm

    aibanez

    4 posts

    I think I found the error, in the view file (flexigrid.php) many times are code like this:
    <link href=”<?=$this->config->item(‘base_url’);?>public/css/style.css” rel=“stylesheet” type=“text/css” >
    My server is interpreting the php code after the href=”<? as it is (text) not like php, i.e. the href does not replace the result of this->config->... etc.
    Why is happening this? Anybody can help me.
    Thank you in advance. 😖

  • #70 / Apr 14, 2010 11:45pm

    zacklander2007

    2 posts

    hi, aibanez i think mybe you try to change delimiter your php from <?= become <?php echo , i hope it help ...

  • #71 / Apr 27, 2010 10:58pm

    anata_arie

    11 posts

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

    I’ve success running flexigrid with oracle db (with CI version 1.7) but that searching still not running well. I’ve changed files:
    database\drivers\oci8\oci8_driver.php line 549-556 for clear escape string when we use active record

    if (strpos($item, '.') !== FALSE)
            {
                $str = str_replace('.', 
    
    $this->_escape_char.'.'.$this->_escape_char, $item);            
            }
            else
            {
                $str=$item;
            }

    Column of Oracle tables usually use Capital character so I’ve changed:
    model/ajax_model line 44

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

    and controller/ajax line 29-35

    $record_items[] = array($row->ID,
                $row->ID,
                $row->ISO,
                $row->NAME,
                '<span>'.addslashes($row->PRINTABLE_NAME).'</span>',
                $row->ISO3,
                $row->NUMCODE,
                '<a ><img >config->item('base_url').'public/images/close.png\'></a> '
                );

    Could anyone give me more solution to running that search feature. Tanks

  • #72 / Apr 29, 2010 6:56am

    vtafsar

    4 posts

    Hello,

      I would like to know is there any option for sorting columns in different order. ie, alphabetic columns should be sorted in ascending order and numeric columns should be sorted in descending order.


    Thank you

  • #73 / Apr 29, 2010 7:25am

    anata_arie

    11 posts

    Hello,

      I would like to know is there any option for sorting columns in different order. ie, alphabetic columns should be sorted in ascending order and numeric columns should be sorted in descending order.


    Thank you

    Yes, it’s
    You can check its demo at http://flexigrid.eyeviewdesign.com/index.php/flexigrid/index

  • #74 / Apr 29, 2010 7:41am

    vtafsar

    4 posts

    Hello,

        On the demo, I couldn’t see any such option. What I need is column ‘Name’ should be sorted in ascending order and column ‘Numbercode’ should be in descending order in first click. Any way, Thank you so much for your quick response.


    Thanks

  • #75 / Apr 29, 2010 8:44am

    anata_arie

    11 posts

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

    I’ve success running flexigrid with oracle db (with CI version 1.7) but that searching still not running well. I’ve changed files:
    database\drivers\oci8\oci8_driver.php line 549-556 for clear escape string when we use active record

    if (strpos($item, '.') !== FALSE)
            {
                $str = str_replace('.', 
    
    $this->_escape_char.'.'.$this->_escape_char, $item);            
            }
            else
            {
                $str=$item;
            }

    Column of Oracle tables usually use Capital character so I’ve changed:
    model/ajax_model line 44

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

    and controller/ajax line 29-35

    $record_items[] = array($row->ID,
                $row->ID,
                $row->ISO,
                $row->NAME,
                '<span>'.addslashes($row->PRINTABLE_NAME).'</span>',
                $row->ISO3,
                $row->NUMCODE,
                '<a ><img >config->item('base_url').'public/images/close.png\'></a> '
                );

    Could anyone give me more solution to running that search feature. Tanks

    Problem solved,  I’ve success to run that quick view with changed libraries/flexigrid.php line 153-156

    if ($key == 0) 
                                $searchstr_final .= " upper(".$searchby.") LIKE '%'||upper('".$value."')||'%' ";
                            else
                                $searchstr_final .= " OR upper(".$searchby.") LIKE '%'||upper('".$value."')||'%' ";
.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases