Part of the EllisLab Network
   
3 of 34
3
Ignited DataTables
Posted: 05 October 2010 05:23 AM   [ Ignore ]   [ # 21 ]  
Summer Student
Total Posts:  2
Joined  10-05-2010

Hi ruizpi,

There is a small mistake on get_filtering. The search is not working. Here is the working updated version.

protected function get_filtering($columns$where$search)
    
{
      $sWhere
="";
      
$TieneParentesis=0;
      if (
$where!="")
      
{
         $sWhere 
.=$where;
      
}


      
if($this->input->post("sSearch") != "")
      
{

        
if ($sWhere!="")
        
{
            $sWhere
.=" AND (";
            
$TieneParentesis=1;
        
}

        
for($i 0$i count($columns); $i++)
          
$sWhere .= $columns[$i] " LIKE '%" $this->input->post("sSearch") . "%' OR ";

        
$sWhere substr_replace($sWhere"", -3);
        if (
$TieneParentesis==1)
            
$sWhere.=")";
      
}

      
if ($sWhere <>"")
          
$sWhere "WHERE " $sWhere;
      return 
$sWhere;
    
Profile
 
 
Posted: 05 October 2010 06:51 AM   [ Ignore ]   [ # 22 ]  
Summer Student
Total Posts:  7
Joined  06-29-2010

hi nicusors,

  I try to test your modification but when i use a group by select it doesn’t work. Test it.

Profile
 
 
Posted: 05 October 2010 07:22 AM   [ Ignore ]   [ # 23 ]  
Summer Student
Total Posts:  7
Joined  06-29-2010

At this point my code that i share with you works fine with querys. I try to filter for 1 column like some examples that create some boxes at the bottom of the table. It doesn’t work with server side processing like my code do. Can anybody help me?

Profile
 
 
Posted: 12 October 2010 04:58 AM   [ Ignore ]   [ # 24 ]  
Grad Student
Avatar
Rank
Total Posts:  88
Joined  07-15-2010

hey guys, i updated the first post and added an initial draft for the “library” version… i haven’t tested it out yet so i was hoping some kind soul can do the testing for me raspberry i haven’t added joins on this one yet as im still pretty much preoccupied… i did add a zip download too if you want…

do send me feedbacks on this…

cheers

 Signature 

Ignited Datatables

Profile
 
 
Posted: 22 October 2010 11:39 PM   [ Ignore ]   [ # 25 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  489
Joined  06-06-2007

I used your code and with a regular request the json file seems fine however when using a post request the following error is generated

An Error Was Encountered.
The action you have requested is not allowed

It’s my bedtime now. I’ll dive into this tomorrow or maybe someone has a solution for me when I wake up :D

Profile
 
 
Posted: 23 October 2010 05:58 AM   [ Ignore ]   [ # 26 ]  
Grad Student
Avatar
Rank
Total Posts:  88
Joined  07-15-2010

that’s a CI2 problem right? perhaps you could find your answer here: http://codeigniter.com/forums/viewthread/163976/#786244

 Signature 

Ignited Datatables

Profile
 
 
Posted: 23 October 2010 11:14 AM   [ Ignore ]   [ # 27 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  489
Joined  06-06-2007
cryogenix - 23 October 2010 09:58 AM

that’s a CI2 problem right? perhaps you could find your answer here: http://codeigniter.com/forums/viewthread/163976/#786244

Thanks that was the problem…

Is there anything already that takes care of queries with joins?

Profile
 
 
Posted: 23 October 2010 11:40 AM   [ Ignore ]   [ # 28 ]  
Research Assistant
Avatar
RankRankRank
Total Posts:  489
Joined  06-06-2007
Jeroen Schaftenaar - 23 October 2010 03:14 PM
cryogenix - 23 October 2010 09:58 AM

that’s a CI2 problem right? perhaps you could find your answer here: http://codeigniter.com/forums/viewthread/163976/#786244

Thanks that was the problem…

Is there anything already that takes care of queries with joins?

I found the joins version already on
http://codeigniter.com/forums/viewthread/164729/

Profile
 
 
Posted: 04 November 2010 01:17 AM   [ Ignore ]   [ # 29 ]  
Summer Student
Avatar
Total Posts:  4
Joined  10-28-2010

great works cryogenix,
i’ve tried your solution integrating CI with Datatables using server side processing. however i cant display pagination. It seems like your datatables library produce table with some bugs with your css.
Im using two_button pagination, but NEXT and PREVIOUS button didnot appear. I’ve imported css file correctly.
Any idea for me to debug this?

Profile
 
 
Posted: 04 November 2010 01:45 AM   [ Ignore ]   [ # 30 ]  
Grad Student
Avatar
Rank
Total Posts:  88
Joined  07-15-2010

thank you for your feedback. since you are using two_button as your sPaginationType, the NEXT and PREVIOUS buttons will actually be there. however if you are seeing it as text, then i’m suspecting you have some image directory issues because as far as i’ve tested, two_button mode should look like this (by default):

http://img257.imageshack.us/img257/2687/2but.png

while on the other hand, full_numbers mode should look like this:

http://img222.imageshack.us/img222/1690/fullnum.png

both of them render correctly in my tests so i think that there is nothing wrong with the code. do check your image directories (in the css: datatables.css) if they point to the previous and back buttons correctly.

cheers
hope it helps…

 Signature 

Ignited Datatables

Profile
 
 
   
3 of 34
3