deep64blue
DaDaBIK Guru
I'm trying to integrate Data Tables into DaDABIK and wonder if it is compatible?
I have added the following to header.php:-
[pre]
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.21/css/jquery.dataTables.css">
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.21/js/jquery.dataTables.js"></script>
[/pre]
I created the following custom PHP page
[pre]
<?php
// don't delete this line, this must be the first line of your code
if(!defined('custom_page_from_inclusion')) { die(); }
require_once('error_handler.php');
require_once('myfunctions.php');
echo "<table id='example' class='display' style='width: 100%;'>";
echo "<thead>";
echo "<tr>";
echo "<th>Name</th>";
echo "<th>Position</th>";
echo "<th>Office</th>";
echo "<th>Age</th>";
echo "<th>Start date</th>";
echo "<th>Salary</th>";
echo "</tr>";
echo "</thead>";
echo "<tbody>";
echo "<tr>";
echo "<td>Tiger Nixon</td>";
echo "<td>System Architect</td>";
echo "<td>Edinburgh</td>";
echo "<td>61</td>";
echo "<td>2011/04/25</td>";
echo "<td>$320,800</td>";
echo "</tr>";
echo "<tr>";
echo "<td>Garrett Winters</td>";
echo "<td>Accountant</td>";
echo "<td>Tokyo</td>";
echo "<td>63</td>";
echo "<td>2011/07/25</td>";
echo "<td>$170,750</td>";
echo "</tr>";
echo "</tbody>";
echo "<tfoot>";
echo "<tr>";
echo "<th>Name</th>";
echo "<th>Position</th>";
echo "<th>Office</th>";
echo "<th>Age</th>";
echo "<th>Start date</th>";
echo "<th>Salary</th>";
echo "</tr>";
echo "</tfoot>";
echo "</table>";
echo "<p><br /><br /></p>";
echo "<script>";
echo "$(document).ready( function () {";
echo "$('#myTable').DataTable();";
echo "} );";
echo "</script>";
?>
[/pre]
A table is displayed but it is unformatted with none of the datatables features or formatting.
I have added the following to header.php:-
[pre]
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.21/css/jquery.dataTables.css">
<script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.21/js/jquery.dataTables.js"></script>
[/pre]
I created the following custom PHP page
[pre]
<?php
// don't delete this line, this must be the first line of your code
if(!defined('custom_page_from_inclusion')) { die(); }
require_once('error_handler.php');
require_once('myfunctions.php');
echo "<table id='example' class='display' style='width: 100%;'>";
echo "<thead>";
echo "<tr>";
echo "<th>Name</th>";
echo "<th>Position</th>";
echo "<th>Office</th>";
echo "<th>Age</th>";
echo "<th>Start date</th>";
echo "<th>Salary</th>";
echo "</tr>";
echo "</thead>";
echo "<tbody>";
echo "<tr>";
echo "<td>Tiger Nixon</td>";
echo "<td>System Architect</td>";
echo "<td>Edinburgh</td>";
echo "<td>61</td>";
echo "<td>2011/04/25</td>";
echo "<td>$320,800</td>";
echo "</tr>";
echo "<tr>";
echo "<td>Garrett Winters</td>";
echo "<td>Accountant</td>";
echo "<td>Tokyo</td>";
echo "<td>63</td>";
echo "<td>2011/07/25</td>";
echo "<td>$170,750</td>";
echo "</tr>";
echo "</tbody>";
echo "<tfoot>";
echo "<tr>";
echo "<th>Name</th>";
echo "<th>Position</th>";
echo "<th>Office</th>";
echo "<th>Age</th>";
echo "<th>Start date</th>";
echo "<th>Salary</th>";
echo "</tr>";
echo "</tfoot>";
echo "</table>";
echo "<p><br /><br /></p>";
echo "<script>";
echo "$(document).ready( function () {";
echo "$('#myTable').DataTable();";
echo "} );";
echo "</script>";
?>
[/pre]
A table is displayed but it is unformatted with none of the datatables features or formatting.
dadabik said:Your current DaDaBIK version
You are using DaDaBIK version 10.2-Manarola enterprise, installed on Jul 16, 2020 (installation code: 157345f10b431e712d), the latest version of DaDaBIK is 10.2-Manarola released on Jul 15, 2020
You are runnning the last release of DaDaBIK
In case you want to upgrade to a more powerful edition (from Pro to Enterprise/Platinum, from Enteprise to Platinum) please contact us.
System info
PHP Version: 7.3.19
mysql version: 5.5.5-10.4.13-MariaDB
Web server: Apache/2.4.43 (Unix) OpenSSL/1.1.1g PHP/7.3.19 mod_perl/2.0.11 Perl/v5.30.3
Client: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.89 Safari/537.36