Welcome Guest, Not a member yet? Register   Sign In
Ignited DataTables

[eluser]Ferry Lukito[/eluser]
@cryogenix thanks..

[quote author="ηυмвєяσηє" date="1328253797"]Probably he didnt / couldnt setup .htaccess file.[/quote]
i think so, i will check it.

thanks so much

[eluser]axmed[/eluser]
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

[eluser]cryogenix[/eluser]
no it will not work.

[eluser]Unknown[/eluser]
Is Version 0.6 the last available version?

[eluser]cryogenix[/eluser]
yes.

[eluser]redraw[/eluser]
please help

my model
Code:
$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

[eluser]redraw[/eluser]
SOLVED
i just add 'FALSE' on my script
Code:
$this->datatables->select("nama, IF(jenkel=1, 'PRIA', IF (jenkel=2, 'WANITA', jenkel)) AS jenkel", FALSE)

[eluser]roomm[/eluser]
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!

[eluser]cryogenix[/eluser]
try the wiki if that will shed some light for you: https://github.com/IgnitedDatatables/Ign...d-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...

[eluser]roomm[/eluser]
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:
Code:
<?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:
Code:
<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'    : '&lt;?php echo base_url();?&gt;index.php/home/read',
      'aoColumns'      :
      [
        
        { 'sName' : 'id' },
         { 'sName' : 'name' },
     { 'sName' : 'email' }
      ],
      'fnServerData': function(sSource, aoData, fnCallback)
      {
        $.ajax
        ({
          'dataType': 'json',
          'type'    : 'POST',
          'url'     : sSource,
          'data'    : aoData,
          'success' : fnCallback
        });
      }
    });
  });
[removed]
  
&lt;/body&gt;
&lt;/html&gt;



thanks for the help!

EDIT: that works!
nothing to solve!




Theme © iAndrew 2016 - Forum software by © MyBB