Welcome Guest, Not a member yet? Register   Sign In
Trouble with jquery external file
#4

[eluser]pickupman[/eluser]
I have tested this and the table does sort as expected.
Code:
//head
//jquery src file
//jquery.tablesorter.js file
//jquery.tablesorter.css file
$(document).ready(function(){
  $("#myTable").tablesorter();
});


//body
$template = array('table_open' => '<table id="myTable" class="tablesorter" border="0" cellpadding="4" cellspacing="0">',
     'heading_row_start'   => '<tr>',
     'heading_row_end'     => '</tr>',
     'heading_cell_start'  => '<th>',
     'heading_cell_end'    => '</th>'
  );  
  $this->table->set_template($template);
  
  $this->table->set_heading('ID', 'Name');
  
  $this->table->add_row(array(1, 'Joe'));
  $this->table->add_row(array(2, 'John'));
  $this->table->add_row(array(3, 'Jeff'));
  
  echo $this->table->generate();

Unless you have copied over a css/theme file, you may think the table is not working like on the demo page, however the column headings should still sort when clicking them.


Messages In This Thread
Trouble with jquery external file - by El Forum - 07-31-2012, 06:40 AM
Trouble with jquery external file - by El Forum - 07-31-2012, 12:39 PM
Trouble with jquery external file - by El Forum - 08-03-2012, 11:05 AM
Trouble with jquery external file - by El Forum - 08-03-2012, 12:17 PM



Theme © iAndrew 2016 - Forum software by © MyBB