TableTools can't work
TableTools can't work
lihai
Posts: 15Questions: 0Answers: 0
I download DataTables-1.9.4.And I open the demo pages in DataTables-1.9.4\extras\TableTools.All of the buttons can't work on click except the button of print.What the problem?And What shall do to make the buttons work like cope、excel?
This discussion has been closed.
Replies
2. If you are running from file:// you need to add a Flash security exception - http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html
Allan
I've forgotten to run it via localserver. At first it was running from file://
I'd like to know how i could add both to my datatable. By just using the the same code of line in one initialisation of a table, i always end up seeing only the buttons for tabletools. Could someone explain it to me?
Could someone explain it to me, by making reference to this code?
[code]<?php
//Verbindungsaufbau mit MySQL Datenbank: Bisher noch Standardwerte
$con = mysql_connect("localhost", "root", "");
if (!$con) {
die("Error: " . mysql_error());
}
//Auswahl der Datenbank 'sample' und deren Tabelle 'countries'
mysql_select_db("sample", $con);
$result = mysql_query("SELECT * FROM countries");
?>
<!DOCTYPE html>
DataTables
<!-- Einbindung externer Dateien bzw JavaScript-Bibliotheken und Cascading Style Sheet -Vorlagen -->
@import "jslib/DataTables-1.9.4/media/css/demo_table_jui.css";
@import "jslib/jquery-ui-1.9.1.custom/css/smoothness/jquery-ui-1.9.1.custom.css";
*{
font-family: arial;
}
<!-- Einrichtung des DataTables-Plugins -->
$(document).ready(function(){
$('#datatables').dataTable({
"sPaginationType":"full_numbers",
"aaSorting":[[2, "desc"]],
"bJQueryUI":true
});
})
<!-- Einrichtung des Selektierens einzelner Reihen. Highlighting Rows -->
var oTable;
$(document).ready(function() {
/* Add a click handler to the rows - this could be used as a callback */
$("#example tbody tr").click( function( e ) {
if ( $(this).hasClass('row_selected') ) {
$(this).removeClass('row_selected');
}
else {
oTable.$('tr.row_selected').removeClass('row_selected');
$(this).addClass('row_selected');
}
});
/* Add a click handler for the delete row */
$('#delete').click( function() {
var anSelected = fnGetSelected( oTable );
if ( anSelected.length !== 0 ) {
oTable.fnDeleteRow( anSelected[0] );
}
} );
/* Init the table */
oTable = $('#example').dataTable( );
} );
/* Get the rows which are currently selected */
function fnGetSelected( oTableLocal )
{
return oTableLocal.$('tr.row_selected');
}
ID
Country
Population
Internet Users
Penetration (% Population)
World % Users
<?php
while ($row = mysql_fetch_array($result)) {
?>
<?=$row['ID']?>
<?=$row['Country']?>
<?=$row['Population']?>
<?=$row['Internet Users']?>
<?=$row['Penetration']?>
<?=$row['World Users']?>
<?php
}
?>
Eine Seite mit der Grafischen Auswertung
[/code]
Thanks.
Robert
Allan
Allan