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]
  • #46 / Jan 17, 2009 10:24am

    Eric Dykstra

    3 posts

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

    Very nice! Thank you Mosos.

    I have the same issue - but the ‘quick fix’ made no difference. Something I’ve done wrong?

    I should add ... I used the Console in FireBug to find this:

    A PHP Error was encountered

    Severity: Notice
    Message:  Undefined property:  Ajax_model::$db
    Filename: models/ajax_model.php
    Line Number: 31

    </div>

    Fatal error:  Call to a member function select() on a non-object in /var/www/domain_name_removed/html
    /system/flexigrid/models/ajax_model.php
    on line 31


    From that it appears the ‘db’ object has not been instantiated but this is an example code set, so I am sure it has.

    Ideas?

    Thanks in advance.

    Eric

    ARGH! Silly mistake on my part. I thought the database library was loaded - it wasn’t! So, I simply added it to the autoload.php file and everything worked like a charm!

    Sorry for wasting everyone’s time - but at least it is here for someone else - so they can avoid the same mistake.

    Thanks,

    Eric

  • #47 / Feb 20, 2009 5:03pm

    Dickram

    1 posts

    Hello guys,
    I am a beginner in programming in general and very new especially in PHP programming.
    With the great documentation en tutorials I managed to implement the Flexigrid in an application (using apache, mysql, php with CI).
    But I do have a prob I can’t solve. I’m trying to concat two fields of a table into the flexigrid, but I get a database error (1064).
    My sql code looks like this;
    $this->db->select (‘personen.volgnr,
                  CONCAT( personen.naam, ’ ‘, personen.voornaam ) as naam,
                  straten.omschrijving as straat,
                  personen.huisnr,
                  personen.woonplaats,
                  districten.omschrijving as district,
                  personen.huistelefoon,
                  personen.werktelefoon,
                  personen.mobiel,
                  personen.emailadres
                  from personen
                  LEFT OUTER JOIN straten
                  ON personen.straat = straten.volgnr
                  LEFT OUTER JOIN districten
                  ON personen.district = districten.volgnr’ ) ;
    This code works fine at command prompt, but I can’t get it to work on the grid.
    Can anyone tell me what I’m doing wrong here??

    Thanks in advance.
    PS: my ajax file and controller file correspond with the (“concatted”) columns in the model file and I also tried escape characters like \’ \’ and also \” \”. Nothing helps….

  • #48 / Feb 22, 2009 9:25pm

    seocoder

    3 posts

    Sorry, I was wrong)

  • #49 / Apr 28, 2009 9:07am

    Nicolas400

    4 posts

    Just wondering.
    Is any way to load FK values ?
    Or the idea is to create and use a View ?

    Best regards. Nicolas

  • #50 / May 07, 2009 3:32pm

    monpire

    2 posts

    Hi, thanks for such a tool.

    I am having some problem implementing even with the example.  No matter what I tried, it just sits there and won’t load the records.

    To see this: Flexigrid Test

    I have set the libraries to autoload database, nothing seemed to help.  Although in FireBug console there seems to be no query passing. 

    Thank you in advance

  • #51 / May 11, 2009 10:31am

    Nicolas400

    4 posts

    Hi, thanks for such a tool.

    I am having some problem implementing even with the example.  No matter what I tried, it just sits there and won’t load the records.

    To see this: Flexigrid Test

    I have set the libraries to autoload database, nothing seemed to help.  Although in FireBug console there seems to be no query passing. 

    Thank you in advance

    Hi, you could call you ajax model (directly in you url), to see if any error when connecting to the database.

  • #52 / May 13, 2009 1:51pm

    phishee

    6 posts

    Hi, thanks for such a tool.

    I am having some problem implementing even with the example.  No matter what I tried, it just sits there and won’t load the records.

    To see this: Flexigrid Test

    I have set the libraries to autoload database, nothing seemed to help.  Although in FireBug console there seems to be no query passing. 

    Thank you in advance

    Monpire - Did you ever get this issue resolved?  I am having similar issues where the datagrid loads but no content is present. 

    I tested it in my local development environment with success but on the production server the results are different. 

    Do you think it is a permissions issue with the ajax call? 

    Thanks - phishee (Brandon)

  • #53 / May 13, 2009 4:02pm

    phishee

    6 posts

    Ok - I am an idiot; got it working.  I had to go back and use the non-JSON method as my server does not have the JSON extension compiled with PHP.  For future reference, as of PHP 5.2.0 the JSON extension is included by default.

    Hope that helps someone - phishee (Brandon)

  • #54 / May 14, 2009 10:56am

    monpire

    2 posts

    Hi, thanks for such a tool.

    I am having some problem implementing even with the example.  No matter what I tried, it just sits there and won’t load the records.

    To see this: Flexigrid Test

    I have set the libraries to autoload database, nothing seemed to help.  Although in FireBug console there seems to be no query passing. 

    Thank you in advance

    I found what the problem was, it was because I wasn’t using PHP5.  As soon as I upgraded to php5 and fixed some minor naming issues - it worked.  So for future reference 😊

  • #55 / May 16, 2009 4:44am

    phpserver

    149 posts

    I have been watching flexigrid quite closely now but i have not come across a fully CRUD implementation.The delete method works just fine but i think a simple demo of the remaining CRU will go a long way,i think.

  • #56 / Jun 21, 2009 8:20am

    I’d just used it here (development server):
    http://hdeya.homeip.net/admin/items/list_all/

    and it works great 😊, thanks a lot !

  • #57 / Jul 27, 2009 4:06pm

    audunfr

    8 posts

    I have a question 😊..

    I have installed flexigrid in my CI project, but it wont work.
    When i go to the ajax file directly it works and the logfile gives me the
    DEBUG - 2009-07-27 21:00:37—> EVD CMS Flexigrid Class Initialized

    When i go to the main page with the <table> it does not show, and i do not get any error messages, the debug message above is also gone.

    Its seems like the javascript issent running. Is there a way to debug this?

    Thanks for an beautiful datagrid. Have missed one 😊.


    Best Regards
    Audun

  • #58 / Aug 18, 2009 12:34am

    mives29

    4 posts

    Hi, just want to ask if I can use this Flexigrid with semi-complex SQLs? My query has about 4 left joins, and I don’t know if it can be done with this Flexigrid. Thanks!

    Additional question, if I use table aliases with different tables, how will this affext the creation of columns?

  • #59 / Nov 05, 2009 5:08pm

    dzpoa

    1 posts

    Hello.

    I need to translate all the texts (that appear to client) to portuguese, but i cant find in what file is the “Quick Search” and the “Page x of y” texts.

    EDIT: ANSWER: u can translate using the $gridParams array or directly in the flexigrid.pack.js file.

    Really thanks!
    DZPOA

  • #60 / Dec 17, 2009 1:22pm

    Sh1n0b1

    1 posts

    Hi,

    Thanks for this wonderful grid implementation.
    Took me a while to figure it out, as I’m new to PHP and CodeIgniter (being a Perl-dude 😊.

    I noticed that this isn’t working (Query error: No tables used):

      $getDocIds_sql = “SELECT uid, folderset, county, doctype FROM panel”;
      $this->db->query($getDocIds_sql);
      $this->CI->flexigrid->build_query();

    but this is :

      $this->db->select(‘uid, folderset, county, doctype’)->from(‘panel’);
      $this->CI->flexigrid->build_query();
         
    Is this intended ?
    Pitty if so, cause I’m trying to implement the following SQL :

    1. Create temp table panel using dbforge, which goes fine.
    2. Put the results of the following query in the grid :

    $getDocIds_sql = “INSERT INTO panel (null, foldername, county, doctype)
                  SELECT foldersets.folderset AS folderset,
                      foldersets.county AS county,
                      foldersets.doctype AS doctype
                  FROM foldersets
                  LEFT JOIN panfoldersets ON foldersets.folderset = panfoldersets.folderset
                    AND foldersets.county = panfoldersets.county
                    AND foldersets.doctype = panfoldersets.doctype
                  WHERE foldersets.docstatus = ‘C’
                    AND (foldersets.folderset like ‘%2009’ || foldersets.folderset like ‘%2010’)
                    AND (foldersets.doctype = ‘realestate’ OR foldersets.doctype = ‘mortgages’)
                    AND panfoldersets.folderset IS NULL
                  GROUP BY folderset, county, doctype”;

    Looking forward to any input or suggestions.
    Thanks.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases