EllisLab text mark
Advanced Search
2 of 28
2
   
Ignited DataTables
Posted: 05 October 2010 06:23 AM   [ Ignore ]   [ # 21 ]   [ Rating: 0 ]
Joined: 2010-10-05
2 posts

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;
    
 
Posted: 05 October 2010 07:51 AM   [ Ignore ]   [ # 22 ]   [ Rating: 0 ]
Joined: 2010-06-29
7 posts

hi nicusors,

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

 
Posted: 05 October 2010 08:22 AM   [ Ignore ]   [ # 23 ]   [ Rating: 0 ]
Joined: 2010-06-29
7 posts

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?

 
Posted: 12 October 2010 05:58 AM   [ Ignore ]   [ # 24 ]   [ Rating: 0 ]
Avatar
Joined: 2010-07-15
90 posts

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

 
Posted: 23 October 2010 12:39 AM   [ Ignore ]   [ # 25 ]   [ Rating: 0 ]
Avatar
Joined: 2007-06-06
511 posts

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

 Signature 

In need for a good host for your Codeigniter Apps? Try Webfaction! It’s fast, reliable, technically sound, in the USA, EU and Asia.

 
Posted: 23 October 2010 06:58 AM   [ Ignore ]   [ # 26 ]   [ Rating: 0 ]
Avatar
Joined: 2010-07-15
90 posts

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

 Signature 

Ignited Datatables

 
Posted: 23 October 2010 12:14 PM   [ Ignore ]   [ # 27 ]   [ Rating: 0 ]
Avatar
Joined: 2007-06-06
511 posts
cryogenix - 23 October 2010 10:58 AM

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

Thanks that was the problem…

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

 Signature 

In need for a good host for your Codeigniter Apps? Try Webfaction! It’s fast, reliable, technically sound, in the USA, EU and Asia.

 
Posted: 23 October 2010 12:40 PM   [ Ignore ]   [ # 28 ]   [ Rating: 0 ]
Avatar
Joined: 2007-06-06
511 posts
Jeroen Schaftenaar - 23 October 2010 04:14 PM
cryogenix - 23 October 2010 10:58 AM

that’s a CI2 problem right? perhaps you could find your answer here: http://ellislab.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://ellislab.com/forums/viewthread/164729/

 Signature 

In need for a good host for your Codeigniter Apps? Try Webfaction! It’s fast, reliable, technically sound, in the USA, EU and Asia.

 
Posted: 04 November 2010 02:17 AM   [ Ignore ]   [ # 29 ]   [ Rating: 0 ]
Avatar
Joined: 2010-10-28
5 posts

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?

 
Posted: 04 November 2010 02:45 AM   [ Ignore ]   [ # 30 ]   [ Rating: 0 ]
Avatar
Joined: 2010-07-15
90 posts

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

 
Posted: 04 November 2010 03:25 AM   [ Ignore ]   [ # 31 ]   [ Rating: 0 ]
Avatar
Joined: 2010-10-28
5 posts

thanks for your fast reply. im really appreciate it.
The path for the button image was correct.
When i check the css for generated table, the DIV for the two button was like this

<div class="dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_two_button" id="list_table_paginate">
<
class="fg-button ui-button ui-state-default ui-corner-left ui-state-disabled" title="Previous" id="list_table_previous"><span class="ui-icon ui-icon-circle-arrow-w"></span></a>
<
class="fg-button ui-button ui-state-default ui-corner-right" title="Next" id="list_table_next"><span class="ui-icon ui-icon-circle-arrow-e"></span></a></div

while it should be the correct way like this

<div class="dataTables_paginate paging_two_button" id="list_table_paginate">
   <
div class="paginate_disabled_previous" title="Previous" id="list_table_previous"></div>
   <
div class="paginate_enabled_next" title="Next" id="list_table_next"></div>
</
div

right now i have no idea where should i change to make it display the correct class

 
Posted: 04 November 2010 04:11 AM   [ Ignore ]   [ # 32 ]   [ Rating: 0 ]
Avatar
Joined: 2010-07-15
90 posts

are you using jquery-ui with your example? coz i admit, i’ve encountered some problems using jquery-ui so i decided to drop using it. aside from that, as i always suggest, try coding datatables first using a static dummy html file and make it work. once it works, it’s easier transfering them to CI…

 Signature 

Ignited Datatables

 
Posted: 04 November 2010 05:36 AM   [ Ignore ]   [ # 33 ]   [ Rating: 0 ]
Avatar
Joined: 2010-10-28
5 posts

thank cyrogenix for enlighten me up. Yup, its about conflict with jquery-ui

after i set bJQueryUI to false from your code sample, then the button apeared

‘bJQueryUI’    : false,

thanks a lot for your help

 
Posted: 04 November 2010 05:58 AM   [ Ignore ]   [ # 34 ]   [ Rating: 0 ]
Avatar
Joined: 2010-07-15
90 posts

i’m very glad i’ve helped (oh wait i did? LOL)...

 Signature 

Ignited Datatables

 
Posted: 04 November 2010 06:15 AM   [ Ignore ]   [ # 35 ]   [ Rating: 0 ]
Avatar
Joined: 2010-10-28
5 posts

LOL

 
2 of 28
2