Welcome Guest, Not a member yet? Register   Sign In
Not showing table properly
#1

[eluser]xtremer360[/eluser]
I'm trying to create a page for my site with the table attached and for some reason it's not attaching the datatables to it.

My page: http://www.kansasoutlawwrestling.com/kow...almessages

Template: http://kansasoutlawwrestling.com/files/t...ables.html

Code:

Code:
<?php echo heading('Inbox Messages', 2, 'class="grid_12"'); ?>
<div class="clear"></div>
<div class="grid_12">
    <div class="box">
        <div class="header">
            &lt;?php $image_properties= array( 'src' => 'assets/peach/img/icons/16x16/user.png', 'height' => '16px', 'width' => '16px', 'alt' => 'User' ); ?&gt;
            &lt;?php echo img($image_properties); ?&gt;
            &lt;?php echo heading('Inbox', 3); ?&gt;
            <span></span>
        </div>
        <div class="content">
            &lt;?php $this->table->set_empty('&nbsp;'); ?&gt;
            &lt;?php $tmpl = array ( 'table_open'  => '<table id="table-example" class="table">' ); ?&gt;
            &lt;?php $this->table->set_template($tmpl); ?&gt;
            &lt;?php $this->table->set_heading('', 'Subject', 'From', ''); ?&gt;
            &lt;?php echo $this->table->generate(); ?&gt;
        </div>
    </div>
</div>
#2

[eluser]InsiteFX[/eluser]
You need to pass your data into it.
Code:
&lt;?php echo $this->table->generate($data); ?&gt;

Besides ll table code should be in your controller except for the table_generate!
#3

[eluser]Samus[/eluser]
Nice site btw
#4

[eluser]xtremer360[/eluser]
What data are you talking about insiteFX?
#5

[eluser]weboap[/eluser]
can you put the <tbody> part and some data in there manually for now so we can troubleshoot the datatable issue
it's a a java issue.
then check inserting the data dynamically...
#6

[eluser]xtremer360[/eluser]
I updated the table and for some reason still not loading the datatables into the table.
#7

[eluser]xtremer360[/eluser]
Any ideas why it doesn't turn it into a datatable when it should be?
#8

[eluser]weboap[/eluser]
check myjs.js
Code:
$(window).load(function() {
    $('#datatable').dataTable();    
}
// you got a syntax error here


try instead

Code:
$(document).ready( function () {


  //check if the datatable table exist.

    if ($("#datatable").length > 0){
    
     //apply dataTable to #datatable table and save its object in dataTable variable
if( typeof dataTable == 'undefined' ){
     dataTable = $( '#datatable' ).dataTable();
}else{
// this two lines to help redraw the table if you add or remove lines
  dataTable.fnClearTable( 0 );
  dataTable.fnDraw();
  }

    }

  
  
  
  
  
});





Theme © iAndrew 2016 - Forum software by © MyBB