Trying to use Datatables- none of the functions are working (sorting pagination etc)
Trying to use Datatables- none of the functions are working (sorting pagination etc)
Hi Guys,
I lvoe this script but Can't seem to get it to work when pulling data from a MySQL table.
this is the code im using in php:
[code]
function table() //used to display the data on the main pages
{
$databasereturn = $this->getData(1);
if(count($databasereturn)>0) //checks that some data comes back if so creates table, if not outputs message
{
$output.="";
$output.="";
$output.="";
$output.="Acronym";
$output.="FullTitle";
$output.="Abstract";
$output.="";
$output.="";
foreach($databasereturn as $query):
$output.="";
$output.="";
$output.="".$query['Acronym']."";
$output.="".$query['FullTitle']."";
$output.="".$query['Abstract']."";
$output.="";
$output.="";
endforeach;
$output.="";
[/code]
It shows all the data from the table howevcer its not sorting or paginating are my tags incorrect?
Thanks guys
I lvoe this script but Can't seem to get it to work when pulling data from a MySQL table.
this is the code im using in php:
[code]
function table() //used to display the data on the main pages
{
$databasereturn = $this->getData(1);
if(count($databasereturn)>0) //checks that some data comes back if so creates table, if not outputs message
{
$output.="";
$output.="";
$output.="";
$output.="Acronym";
$output.="FullTitle";
$output.="Abstract";
$output.="";
$output.="";
foreach($databasereturn as $query):
$output.="";
$output.="";
$output.="".$query['Acronym']."";
$output.="".$query['FullTitle']."";
$output.="".$query['Abstract']."";
$output.="";
$output.="";
endforeach;
$output.="";
[/code]
It shows all the data from the table howevcer its not sorting or paginating are my tags incorrect?
Thanks guys
This discussion has been closed.
Replies
Please link to a test case.
Allan
I can get this script to work if im creating a table in html however as I'm pulling the data from mysql table the sorting, pagination and css is not working.
The options appear to limit the rows, however the rows are not limiting and when i click the header titles they are not sorting.
Can I post an image of it instead? I cant post a direct link either as it is on an internal restricted network.
the Table summary seems to show the rows as 1 in debugger?
The datatable is only recognising row 1 however the whole table is loading above it.
Allan
Such a stupid error :smack:
Its working perfectly now thanks :D