server side processing
server side processing
Hi,
I first apologize for my english because i'm french !
I started using datatables few days ago and I wonder if i'm doing things in right way.
I would like to draw a table and select one ligne and put info about that selected ligne in #quote div.
The thing is that i would like to get the data from the server side (with the sAjaxSource) but let the sorting, filtering and searching from the client side.
But with my code, when i ask, for instance, for searching, i get the "processing..." but nothing happens. And it is the same with the sorting. I click on a column so it sorts the column and when i click again i would expect a "inverse" sorting but nothing else happens.
So is it possible to get all the data from the server side and let the client side making all the stuff ?
Does it make sense ? One more thing, I just have less than 1000 records in my table.
Thanks for your help
[code]
$(document).ready(function() {
oTable=$('#the_table').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sPaginationType": "full_numbers",
"bFilter": true,
"aoColumns": [
{ "bSearchable": true, "bSortable": true },
{ "bSearchable": false, "bSortable": false },
{ "bSearchable": false, "bSortable": false },
{ "bSearchable": true, "bSortable": true }
],
"sAjaxSource": "/test",
"fnDrawCallback":function (oSettings){
$('#the_table tr:not(.entete)').live("click", function () {
//id:the_table dont le tr n'a pas de classe "entete"
$('#the_table tr:not(.entete)').each( function () {
$(this).removeClass('row_selected');
} );
if ( $(this).hasClass('row_selected') )
$(this).removeClass('row_selected');
else
$(this).addClass('row_selected');
var iPos = oTable.fnGetPosition(this);
var aData = oTable.fnGetData( iPos ); // row
var id = aData[3]; //field
$('#quote').html('');
//}) ;
});
} // close of fnDrawCallback
}) ;
/* click event Handler */
$('.entete').live("click", function () {
$('#quote').html('');
});
} );
[/code]
I first apologize for my english because i'm french !
I started using datatables few days ago and I wonder if i'm doing things in right way.
I would like to draw a table and select one ligne and put info about that selected ligne in #quote div.
The thing is that i would like to get the data from the server side (with the sAjaxSource) but let the sorting, filtering and searching from the client side.
But with my code, when i ask, for instance, for searching, i get the "processing..." but nothing happens. And it is the same with the sorting. I click on a column so it sorts the column and when i click again i would expect a "inverse" sorting but nothing else happens.
So is it possible to get all the data from the server side and let the client side making all the stuff ?
Does it make sense ? One more thing, I just have less than 1000 records in my table.
Thanks for your help
[code]
$(document).ready(function() {
oTable=$('#the_table').dataTable( {
"bProcessing": true,
"bServerSide": true,
"sPaginationType": "full_numbers",
"bFilter": true,
"aoColumns": [
{ "bSearchable": true, "bSortable": true },
{ "bSearchable": false, "bSortable": false },
{ "bSearchable": false, "bSortable": false },
{ "bSearchable": true, "bSortable": true }
],
"sAjaxSource": "/test",
"fnDrawCallback":function (oSettings){
$('#the_table tr:not(.entete)').live("click", function () {
//id:the_table dont le tr n'a pas de classe "entete"
$('#the_table tr:not(.entete)').each( function () {
$(this).removeClass('row_selected');
} );
if ( $(this).hasClass('row_selected') )
$(this).removeClass('row_selected');
else
$(this).addClass('row_selected');
var iPos = oTable.fnGetPosition(this);
var aData = oTable.fnGetData( iPos ); // row
var id = aData[3]; //field
$('#quote').html('');
//}) ;
});
} // close of fnDrawCallback
}) ;
/* click event Handler */
$('.entete').live("click", function () {
$('#quote').html('');
});
} );
[/code]
This discussion has been closed.