Server-sided click problem
Server-sided click problem
Hey guys,
I'm still really new to coding as a whole and im currently really rather stuck.
What I want to do:
I want to be able to select multiples rows from a table (Sever-sided, mySQL through PHP) with values (First_name, last_name, telephone) and inserting one row for each selected row into a MySQL table, using the telephone value of this row and, for every row, an identical varchar(160) field based on a textfield.
How I want to do this:
I'm thinking through the use of the click function, but I just can't get it to work.
This is my code so far:
[code]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
DataTables example
@import "/css/demo_page.css";
@import "/css/demo_table.css";
$(document).ready(function() {
$('#composer').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "/test/server_processing.php"
} );
/* add/remove class to row when clicked on */
$('#composer tr').click( function() {
$(this).toggleClass('row_selevted');
} );
/* Initiatlize the table */
var oTable = $('#composer').dataTable( );
} );
/* tr nodes from DataTables*/
function fnGetSelected( oTableLocal )
{
return oTableLocal.$('tr.row_selected');
}
DataTables server-side processing example
Voornaam
Achternaam
Mobiel
Loading data from server
Loading data from server
Loading data from server
Voornaam
Achternaam
Mobiel
[/code]
I'm still really new to coding as a whole and im currently really rather stuck.
What I want to do:
I want to be able to select multiples rows from a table (Sever-sided, mySQL through PHP) with values (First_name, last_name, telephone) and inserting one row for each selected row into a MySQL table, using the telephone value of this row and, for every row, an identical varchar(160) field based on a textfield.
How I want to do this:
I'm thinking through the use of the click function, but I just can't get it to work.
This is my code so far:
[code]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
DataTables example
@import "/css/demo_page.css";
@import "/css/demo_table.css";
$(document).ready(function() {
$('#composer').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sAjaxSource": "/test/server_processing.php"
} );
/* add/remove class to row when clicked on */
$('#composer tr').click( function() {
$(this).toggleClass('row_selevted');
} );
/* Initiatlize the table */
var oTable = $('#composer').dataTable( );
} );
/* tr nodes from DataTables*/
function fnGetSelected( oTableLocal )
{
return oTableLocal.$('tr.row_selected');
}
DataTables server-side processing example
Voornaam
Achternaam
Mobiel
Loading data from server
Loading data from server
Loading data from server
Voornaam
Achternaam
Mobiel
[/code]
This discussion has been closed.
Replies
correcting it, sadly, doesn't fix my problems.