EllisLab text mark
Advanced Search
21 of 28
21
   
Ignited DataTables
Posted: 26 January 2012 01:01 AM   [ Ignore ]   [ # 311 ]   [ Rating: 0 ]
Joined: 2010-06-25
6 posts

http://ellislab.com/forums/viewthread/160896/P30/#833732

my javascript in header is as follow

[removed] 
  $(document).ready(function() {
  $(’#example’).dataTable( {
  “bProcessing”: true,
  “aaSorting”: [[ 1, “desc” ]],
  “bServerSide”: true,
  “sAjaxSource”: “<?php echo base_url(); ?>poli/poliumumlist”,
  “sScrollY”: 200,
  “bJQueryUI”: true,
  “sPaginationType”: “full_numbers”
  } );
  } );

  function fnShowHide( iCol ) {
  var oTable = $(’#example’).dataTable();
 
  var bVis = oTable.fnSettings().aoColumns[iCol].bVisible;
  oTable.fnSetColumnVis( iCol, bVis ? false : true );
  }
[removed]


the result from /poli/poliumumlist is a below
{“sEcho”:0,“iTotalRecords”:“4”,“iTotalDisplayRecords”:“4”,“aaData”:[[“7”,“24 Jan 2012”,“005000430”,“Sutono”,“L”,“41”,“Ya”,null],[“2”,“24 Jan 2012”,“005000110”,“Sudrajat”,“L”,“31”,“Ya”,“Mario”],[“1”,“23 Jan 2012”,“005000120”,“Sutini”,“P”,“22”,“Ya”,“Isabel”],[“6”,“23 Dec 2011”,“099000231”,“Agung”,“L”,“27”,“Ya”,“Mario”]]}

 
Posted: 26 January 2012 01:40 AM   [ Ignore ]   [ # 312 ]   [ Rating: 0 ]
Avatar
Joined: 2010-07-15
90 posts

and what is your controller code?

 Signature 

Ignited Datatables

 
Posted: 02 February 2012 10:11 AM   [ Ignore ]   [ # 313 ]   [ Rating: 0 ]
Joined: 2012-02-02
2 posts

please help

why this code is work for me

$(document).ready(function() 
    

        
$('#sortable_table').dataTable({
            
"sScrollY"430,
            
"bJQueryUI"true,
            
"sPaginationType""full_numbers",
            
"bProcessing"true,
            
"bServerSide"true,
            
"sAjaxSource""<?php echo base_url(); ?>index.php/customers/getall"
        
});
    
}); 

and this code is’nt work

$(document).ready(function() 
    

        
$('#sortable_table').dataTable({
            
"sScrollY"430,
            
"bJQueryUI"true,
            
"sPaginationType""full_numbers",
            
"bProcessing"true,
            
"bServerSide"true,
            
"sAjaxSource""<?php echo base_url(); ?>customers/getall"
        
});
    
}); 

is there need setup the route ?
thanks.

 
Posted: 03 February 2012 01:16 AM   [ Ignore ]   [ # 314 ]   [ Rating: 0 ]
Avatar
Joined: 2010-07-15
90 posts
Ferry Lukito - 02 February 2012 10:11 AM

please help

why this code is work for me

$(document).ready(function() 
    

        
$('#sortable_table').dataTable({
            
"sScrollY"430,
            
"bJQueryUI"true,
            
"sPaginationType""full_numbers",
            
"bProcessing"true,
            
"bServerSide"true,
            
"sAjaxSource""<?php echo base_url(); ?>index.php/customers/getall"
        
});
    
}); 

and this code is’nt work

$(document).ready(function() 
    

        
$('#sortable_table').dataTable({
            
"sScrollY"430,
            
"bJQueryUI"true,
            
"sPaginationType""full_numbers",
            
"bProcessing"true,
            
"bServerSide"true,
            
"sAjaxSource""<?php echo base_url(); ?>customers/getall"
        
});
    
}); 

is there need setup the route ?
thanks.

maybe you didn’t setup aoColumns?

 Signature 

Ignited Datatables

 
Posted: 03 February 2012 03:23 AM   [ Ignore ]   [ # 315 ]   [ Rating: 0 ]
Avatar
Joined: 2011-03-26
109 posts

Probably he didnt / couldnt setup .htaccess file.

 Signature 

Ignited Datatables
Nested Sets

 
Posted: 03 February 2012 03:27 AM   [ Ignore ]   [ # 316 ]   [ Rating: 0 ]
Joined: 2012-02-02
2 posts

@cryogenix thanks..

ηυмвєяσηє - 03 February 2012 03:23 AM

Probably he didnt / couldnt setup .htaccess file.

i think so, i will check it.

thanks so much

 
Posted: 09 February 2012 09:16 PM   [ Ignore ]   [ # 317 ]   [ Rating: 0 ]
Joined: 2010-02-04
8 posts

if user has JavaScript turned off will this library still work?
since produce_output function outputs json encoded string, how to change it to output html for progressive enhancement.
a plain HTML table, drawn for the benefit of people who dont have JavaScript enabled
thanks

 
Posted: 13 February 2012 12:08 AM   [ Ignore ]   [ # 318 ]   [ Rating: 0 ]
Avatar
Joined: 2010-07-15
90 posts

no it will not work.

 Signature 

Ignited Datatables

 
Posted: 14 February 2012 04:18 AM   [ Ignore ]   [ # 319 ]   [ Rating: 0 ]
Joined: 2012-02-14
1 posts

Is Version 0.6 the last available version?

 
Posted: 14 February 2012 09:17 PM   [ Ignore ]   [ # 320 ]   [ Rating: 0 ]
Avatar
Joined: 2010-07-15
90 posts

yes.

 Signature 

Ignited Datatables

 
Posted: 27 February 2012 04:27 AM   [ Ignore ]   [ # 321 ]   [ Rating: 0 ]
Avatar
Joined: 2011-03-16
45 posts

please help

my model

$this->load->library('Datatables');
$this->datatables->select("nama, IF(jenkel=1, 'PRIA', IF (jenkel=2, 'WANITA', jenkel)) AS jenkel")
->
from('tu_maskar')
return 
$this->datatables->generate(); 

why if statement on ‘select’ query isn’t work? i have been tested on sqlYog is work fine

 Signature 

belajar adalah sebuah keberanian diri untuk menantang ketidakmungkinan.

belajar dengan sungguh-sungguh hanya bisa di lakukan oleh seseorang yang bukan penakut.

 
Posted: 28 February 2012 04:16 AM   [ Ignore ]   [ # 322 ]   [ Rating: 0 ]
Avatar
Joined: 2011-03-16
45 posts

SOLVED
i just add ‘FALSE’ on my script

$this->datatables->select("nama, IF(jenkel=1, 'PRIA', IF (jenkel=2, 'WANITA', jenkel)) AS jenkel"FALSE
 Signature 

belajar adalah sebuah keberanian diri untuk menantang ketidakmungkinan.

belajar dengan sungguh-sungguh hanya bisa di lakukan oleh seseorang yang bukan penakut.

 
Posted: 01 March 2012 03:14 PM   [ Ignore ]   [ # 323 ]   [ Rating: 0 ]
Joined: 2012-03-01
2 posts

hi everyone! i’m starting with codeigniter and i need a jquery datatable.
i don’t know how to join codeigter and this library.
please can someone help me with onine example? thanks for everything!

 
Posted: 05 March 2012 02:50 AM   [ Ignore ]   [ # 324 ]   [ Rating: 0 ]
Avatar
Joined: 2010-07-15
90 posts

try the wiki if that will shed some light for you: https://github.com/IgnitedDatatables/Ignited-Datatables/wiki/Method-Chaining

i will try to give a full blown example as soon as i get some time off… really really busy right now so i’m kind of sorry for the inactivity…

 Signature 

Ignited Datatables

 
Posted: 05 March 2012 09:37 AM   [ Ignore ]   [ # 325 ]   [ Rating: 0 ]
Joined: 2012-03-01
2 posts

hi! thnx for the reply! i’m working on it!
i thing it works nearly well because it shows the number of result properly but not show any result only a messagebox saying:  DataTables warning(table id=‘test’): Requested unknown parameter ‘0’ from the data source for row 0.

the controller:

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class 
Home extends CI_Controller {
 
public function __construct()
 
{
  parent
::__construct();
  
$this->load->model'mUsers' );
 
}
 
public function index()
 
{
  $this
->load->view'home' );
 
}
 
public function read()
 
{
  $this
->load->library('Datatables'); 
  
$this->datatables
  
->select('id, name,email')
   ->
from('users');
  echo 
$this->datatables->generate();
  
 
}


and the view:

<html>
 <
head>
  <
title>
   
Test
  
</title>
  <
base href="<?php echo base_url(); ?>" />
  <
link type="text/css" rel="stylesheet" href="css/smoothness/jquery-ui-1.8.2.custom.css" />
  <
link type="text/css" rel="stylesheet" href="css/styles.css" />
  
[removed][removed]
  [removed][removed]
</head>
 <
body>
  <
div id="dt_example">
  <
table id="test" class="display">
    <
thead>
      <
tr>
        <
th>ID</th>
        <
th>Name</th>
        <
th>mail</th>
      </
tr>
    </
thead>
    <
tbody>
      <
tr>
        <
td colspan="3" class="dataTables_empty">Loading...</td>
      </
tr>
    </
tbody>
  </
table>
</
div>
[removed]
  
var sity;

  $(
document).ready(function()
  
{
    sity 
= $('#test').dataTable
    
({
      
'iCookieDuration'60,
      
'bStateSave'     true,
      
'bServerSide'    true,
      
'bAutoWidth'     false,
      
'sPaginationType''full_numbers',
      
'sAjaxSource'    '<?php echo base_url();?>index.php/home/read',
      
'aoColumns'      
      
[
        
        { 
'sName' 'id' },
         
'sName' 'name' },
     
'sName' 'email' }
      ]
,
      
'fnServerData': function(sSourceaoDatafnCallback)
      
{
        
$.ajax
        
({
          
'dataType''json',
          
'type'    'POST',
          
'url'     sSource,
          
'data'    aoData,
          
'success' fnCallback
        }
);
      
}
    }
);
  
});
[removed]
   
 
</body>
</
html

 

thanks for the help!

EDIT: that works!
nothing to solve!

 
21 of 28
21