DataTables warning (table id = 'example'):
DataTables warning (table id = 'example'):
Hello!
I have big problem. J spent more time and I can't find soulution. I see still "discusion title" message. Please Help me. In attach code. Greetings i Hepy Christmas and new year!!
html file
[code]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
DataTables example
@import "../../media/css/demo_page.css";
@import "../../media/css/demo_table.css";
$(document).ready(function() {
$('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "scripts/server_processing.php"
} );
} );
DataTables server-side processing example
Preamble
There are many ways to get your data into DataTables, and if you are working with seriously large databases, you might want to consider using the server-side options that DataTables provides. Basically all of the paging, filtering, sorting etc that DataTables does can be handed off to a server (or any other data source - Google Gears or Adobe Air for example!) and DataTables is just an events and display module.
The example here shows a very simple display of the CSS data (used in all my other examples), but in this instance coming from the server on each draw. Filtering, multi-column sorting etc all work as you would expect.
Live example
ID
Numer telefonu
SIM
PUK/PIN
PUK2
Adres
Miejsce
Operator
Loading data from server
ID
Numer telefonu
SIM
PUK/PIN
PUK2
Adres
Miejsce
Operator
Initialisation code
$(document).ready(function() {
$('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "scripts/server_processing.php"
} );
} );
@import "../examples_support/syntax/css/shCore.css";
Server response
The code below shows the latest JSON data that has been returned from the server in response to the Ajax request made by DataTables. This will update as further requests are made.
Server side (PHP) code
<?php
[/code]
php server side file
[code]
<?php
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Easy set variables
*/
/* Array of database columns which should be read and sent back to DataTables. Use a space where
* you want to insert a non-database field (for example a counter or static image)
*/
$aColumns = array( `Id_wpisu`, `Numer_telefonu`, `SIM`, `PUK/PIN`, `PUK2`, `Adres`, `Miejsce`, `Operator` );
/* Indexed column (used for fast and accurate table cardinality) */
$sIndexColumn = "Id_wpisu";
/* DB table to use */
$sTable = "zestawienie";
/* Database connection information */
$gaSql['user'] = "root";
$gaSql['password'] = "....";
$gaSql['db'] = "kary_sim";
$gaSql['server'] = "....";
/* REMOVE THIS LINE (it just includes my SQL connection user/pass) */
/*include( $_SERVER['DOCUMENT_ROOT']."/datatables/mysql.php" );
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
ect. the same in server procesing file
[/code]
I have big problem. J spent more time and I can't find soulution. I see still "discusion title" message. Please Help me. In attach code. Greetings i Hepy Christmas and new year!!
html file
[code]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
DataTables example
@import "../../media/css/demo_page.css";
@import "../../media/css/demo_table.css";
$(document).ready(function() {
$('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "scripts/server_processing.php"
} );
} );
DataTables server-side processing example
Preamble
There are many ways to get your data into DataTables, and if you are working with seriously large databases, you might want to consider using the server-side options that DataTables provides. Basically all of the paging, filtering, sorting etc that DataTables does can be handed off to a server (or any other data source - Google Gears or Adobe Air for example!) and DataTables is just an events and display module.
The example here shows a very simple display of the CSS data (used in all my other examples), but in this instance coming from the server on each draw. Filtering, multi-column sorting etc all work as you would expect.
Live example
ID
Numer telefonu
SIM
PUK/PIN
PUK2
Adres
Miejsce
Operator
Loading data from server
ID
Numer telefonu
SIM
PUK/PIN
PUK2
Adres
Miejsce
Operator
Initialisation code
$(document).ready(function() {
$('#example').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "scripts/server_processing.php"
} );
} );
@import "../examples_support/syntax/css/shCore.css";
Server response
The code below shows the latest JSON data that has been returned from the server in response to the Ajax request made by DataTables. This will update as further requests are made.
Server side (PHP) code
<?php
[/code]
php server side file
[code]
<?php
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Easy set variables
*/
/* Array of database columns which should be read and sent back to DataTables. Use a space where
* you want to insert a non-database field (for example a counter or static image)
*/
$aColumns = array( `Id_wpisu`, `Numer_telefonu`, `SIM`, `PUK/PIN`, `PUK2`, `Adres`, `Miejsce`, `Operator` );
/* Indexed column (used for fast and accurate table cardinality) */
$sIndexColumn = "Id_wpisu";
/* DB table to use */
$sTable = "zestawienie";
/* Database connection information */
$gaSql['user'] = "root";
$gaSql['password'] = "....";
$gaSql['db'] = "kary_sim";
$gaSql['server'] = "....";
/* REMOVE THIS LINE (it just includes my SQL connection user/pass) */
/*include( $_SERVER['DOCUMENT_ROOT']."/datatables/mysql.php" );
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
ect. the same in server procesing file
[/code]
This discussion has been closed.
Replies